[Cubicweb] ZMQ: IP address

Dimitri Papadopoulos Orfanos dimitri.papadopoulos at cea.fr
Thu Sep 26 14:33:10 CEST 2013


Hi,

That's indeed how sockets work. However higher level objects often bind 
to all network interfaces by default. For example:
   http://qt-project.org/doc/qt-5.0/qtnetwork/qtcpserver.html#listen

I don't have a zmq_tcp(7) man page on my machine, but both "0.0.0.0" 
(for IPv4) and "*" seem to be doing the trick:
	zmq-repository-address=zmqpickle-tcp://0.0.0.0:8181
	zmq-repository-address=zmqpickle-tcp://*:8181

Le 25/09/2013 17:22, Julien Cristau a écrit :
> On Wed, Sep 25, 2013 at 17:16:34 +0200, Dimitri Papadopoulos Orfanos wrote:
>
>> Hi,
>>
>> I've noticed that ZMQ responds only when connecting to the specific
>> IP that was set in all-in-one.conf. Examples:
>>
>>
>> If all-in-one.conf contains:
>>    zmq-repository-address=zmqpickle-tcp://127.0.0.1:8181
>> then if 132.12.3.4 is my IP address:
>>    $
>>    $ telnet 127.0.0.1 8181
>>    Trying 127.0.0.1...
>>    Connected to 127.0.0.1.
>>    Escape character is '^]'.
>>    ...
>>    $
>>    $ telnet 132.12.3.4 8181
>>    Trying 132.12.3.4...
>>    telnet: Unable to connect to remote host: Connection refused
>>    $
>>
>>
>> If all-in-one.conf contains:
>>    zmq-repository-address=zmqpickle-tcp://132.12.3.4:8181
>> then:
>>    $
>>    $ telnet 127.0.0.1 8181
>>    Trying 127.0.0.1...
>>    telnet: Unable to connect to remote host: Connection refused
>>    $
>>    $ telnet 132.12.3.4 8181
>>    Trying 132.12.3.4...
>>    Connected to 132.12.13.4.
>>    Escape character is '^]'.
>>    ...
>>    $
>>
>>
>> Is this a ZMQ or CubicWeb feature? Do we have to hardcode the
>> current IP address of the server in all-in-one.conf?
>>
>>
> It's how the socket API works...  You can listen on the wildcard address
> though, and connect using any of the machine's IPs you want.  See the
> zmq_tcp(7) manpage.
>
> Cheers,
> Julien

-- 
Dimitri Papadopoulos
CEA/Saclay
I2BM, NeuroSpin
F-91191 Gif-sur-Yvette cedex, France



More information about the Cubicweb mailing list