[zeromq-dev] Re: re: puzzled with zmq_socket bind and connect

charleszhangjie at qq.com
Fri Nov 9 08:47:19 CET 2012


According to the zmq api reference, there is the description of zmq_bind  

Description
 
The zmq_bind() function shall create an endpoint for accepting  connections and bind it to the socket referenced by the socket  argument.
 
The endpoint argument is a string consisting of two parts as  follows: transport ://address. The  transport part specifies the underlying transport protocol to use. The  meaning of the address part is specific to the underlying transport  protocol selected.

so, it only can be used to accept connections. we cannot control source IP address when send a zmq message, right? If a machine has more than one interface (e.g. eth0, eth0:1,  eth1 ....)  we cannot specify a source IP address. Is there any method to realize such a requirement using zmq libary?



 




------------------ 原始邮件 ------------------
发件人: "猫"<charleszhangjie at qq.com>;
发送时间: 2012年11月9日(星期五) 上午10:27
收件人: "ZeroMQ development list"<zeromq-dev at lists.zeromq.org>; 

主题: Re: [zeromq-dev]re: puzzled with zmq_socket bind and connect



sorry, I made a mistake. "the net interface eth0 has two ip 1.2.3.4 and 5.6.7.8"


actually eth0 is  1.2.3.4  while  eth0:1 is 5.6.7.8 according to what ifconfig tool shows
 when I set a REQ (not REP) zmq_socket bind to eth0 or eth0:1, it seems not work as expected, the message is always sent from 5.6.7.8 to the destination. Even I use specific IP address to bind rather than interface name, the result does not change.
can we  use zmq to control the source IP address on a connection to force the traffic ?


------------------ 原始邮件 ------------------
发件人: "Steven McCoy"<steven.mccoy at miru.hk>;
发送时间: 2012年11月9日(星期五) 上午9:50
收件人: "ZeroMQ development list"<zeromq-dev at lists.zeromq.org>; 

主题: Re: [zeromq-dev]re: puzzled with zmq_socket bind and connect



On 9 November 2012 01:21, 猫 <charleszhangjie at qq.com> wrote:
 the net interface eth0 has two ip 1.2.3.4 and 5.6.7.8
 
 





Can you provide a dump of the interface enumeration?  Each interface should still be unique, usually for IPv4 you would see eth0:0 and eth0:1, IPv6 permits multiple addresses on the same name but provides a unique index for each.
 

Workaround as ever is to specify the IP address or use the network name.


-- 
Steve-o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20121109/54c7330d/attachment.htm>


More information about the zeromq-dev mailing list