1. 程式人生 > >ZeroMQ介面函式之 :zmq_bind

ZeroMQ介面函式之 :zmq_bind

1 /* Create a ZMQ_PUB socket */ 2 3 void *socket = zmq_socket (context, ZMQ_PUB); 4 5 assert (socket); 6 7 /* Bind it to a in-process transport with the address 'my_publisher' */ 8 9 int rc = zmq_bind (socket, "inproc://my_publisher"); 10 11 assert (rc == 0); 12 13 /* Bind it to a TCP transport on port 5555 of the 'eth0' interface
*/ 14 15 rc = zmq_bind (socket, "tcp://eth0:5555"); assert (rc == 0);