[zeromq-dev] one android phone communicate to another using zeromq
Ian Barber
ian.barber at gmail.com
Mon Jul 1 22:25:06 CEST 2013
The IPs should match - you connect from one to the other (so you bind on
one, connect to that one from the other). I would definitely recommend
working through the guide a little to get the basic concepts down:
http://zguide.zeromq.org
Ian
On Mon, Jul 1, 2013 at 9:05 PM, ashwini ramamurthy
<ashwini.ram21 at gmail.com>wrote:
> Thanks edwin, yes 11.22.6.143 is the servers ip address.
>
> // in the client
> ZMQ.Socket s = context.socket(ZMQ.REQ);
> s.connect("tcp://11.22.6.142:8080");
>
> I used the ping and dns app in android to see if i could ping the other
> device. I am able to ping with the above ip address but my app is not able
> to send messages . I still havent figured about whats wrong.
>
> Thanks,
> Ashwini
>
>
> On Mon, Jul 1, 2013 at 3:55 PM, Edwin van den Oetelaar <edwin at oetelaar.com
> > wrote:
>
>> 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
>>>
>>>
>>
>> _______________________________________________
>> 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/5d9718d1/attachment.htm>
More information about the zeromq-dev
mailing list