[zeromq-dev] one android phone communicate to another using zeromq

Edwin van den Oetelaar edwin at oetelaar.com
Mon Jul 1 21:55:12 CEST 2013


If I read the docs correctly, you do not need to bind (the server) to a
specific IP address.
tcp://*:8080
You can bind to all interfaces and all adresses at once on a specific port
number.

Then you connect() to the IP address of the OTHER side (not your own, so
the client connects to the server IP:port)
This is the normal way TCP servers/clients operate.

Good luck,
Edwin van den Oetelaar


On Mon, Jul 1, 2013 at 7:42 PM, Ashwini <ashwini.ram21 at gmail.com> wrote:

> Oh,is it ? But the client and server are in 2 different devices so they
> have different ip addresses . I thought the Port number should be the same
> not the IP address .
>
>
>
> On 01-Jul-2013, at 1:12 PM, Shon Love <slove at fatpot.com> wrote:
>
> Hey,
>
>   I believe the address in the connect call should match the address in
> the bind call.
>
> Thanks,
> Shon
>
>
> On Mon, Jul 1, 2013 at 9:30 AM, ashwini ramamurthy <
> ashwini.ram21 at gmail.com> wrote:
>
>> Thanks for the link . I went through it . I have done something very
>> similar.
>> As this is just a test app i have fixed the ip address  i.e ip is not
>> given by the user. I am using the req-reply pattern where i have one client
>> and one server. Both the devices are connected to the same wifi . I have
>> obtained the ip address from the phone and used that to connect.
>> But still i don't see any messages being received by the server. I don't
>> know where i am going wrong and what i am missing.
>>
>> Below is the code used to connect
>>
>> // in the server
>> ZMQ.Socket socket = context.socket(ZMQ.REP);
>> socket.bind("tcp://11.22.6.161:8080");// in the client
>> ZMQ.Socket s = context.socket(ZMQ.REQ);
>> s.connect("tcp://11.22.6.142:8080");
>>
>>
>> Any tips or suggestions would be really helpful.
>>
>> Thanks,
>> Ashwini
>>
>>
>> On Mon, Jul 1, 2013 at 12:04 AM, shancat <shannenlaptop at gmail.com> wrote:
>>
>>> Check out https://github.com/eggerdo/ZmqVideoChat
>>> On Jul 1, 2013 2:02 PM, "ashwini ramamurthy" <ashwini.ram21 at gmail.com>
>>> wrote:
>>>
>>>> Hi,
>>>>
>>>> I wanted 2 android apps in different devices to communicate using
>>>> zeromq. Both the devices will be in the same network and connected to the
>>>> same wifi . I went through the guide :chapter 8 but im still unsure how to
>>>> go about it. Any ideas, tips would be really helpful.
>>>>
>>>> Thanks,
>>>> Ashwini
>>>>
>>>> _______________________________________________
>>>> zeromq-dev mailing list
>>>> zeromq-dev at lists.zeromq.org
>>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>>
>>>>
>>> _______________________________________________
>>> zeromq-dev mailing list
>>> zeromq-dev at lists.zeromq.org
>>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>>
>>>
>>
>> _______________________________________________
>> zeromq-dev mailing list
>> zeromq-dev at lists.zeromq.org
>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>>
>>
>
>
> --
> Shon C. Love
> Programmer
>
>  _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130701/fb3254a1/attachment.htm>


More information about the zeromq-dev mailing list