ZeroMQ, how to connect to an external tcp socket?

Could you tell me how you can use ZeroMQ to send messages between two programs located on different servers using some common socket? It works with all local socket programs, but I don’t understand how they are distributed in different places. Because the error comes up:

Traceback (most recent call last):
  File "/Users/*****/Projects/*****/workers/internal_links_parser.py", line 20, in <module>
    socket.bind("tcp://***.***.***.***:5000")
  File "socket.pyx", line 447, in zmq.core.socket.Socket.bind (zmq/core/socket.c:4312)
zmq.core.error.ZMQError: Can't assign requested address

Please explain, and if it is not difficult to give an example. thank!

+5
source share
2 answers

From the manual zmq sockets on Socket.bind;

This forces the socket to listen on the network port. Sockets on the other side of this connection will use Socket.connect (addr) to connect to this socket.

, 0mq ; - socket.bind("tcp://0.0.0.0:5000") IP- 5000.

Socket.connect URL- socket.connect("tcp://remoteip:5000") .

, , bind .

+8

. .

, , telnet:

telnet serverIPaddress serverPortNo
+2

All Articles