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?
------------------ ???????? ------------------
??????: "??"<[email protected]>;
????????: 2012??11??9??(??????) ????10:27
??????: "ZeroMQ development list"<[email protected]>;
????: 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"<[email protected]>;
????????: 2012??11??9??(??????) ????9:50
??????: "ZeroMQ development list"<[email protected]>;
????: Re: [zeromq-dev]re?? puzzled with zmq_socket bind and connect
On 9 November 2012 01:21, ?? <[email protected]> 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
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev