[zeromq-dev] ZeroMQ only working with local loopback
Leonard Michelet
leonard.michelet at openwide.fr
Fri Aug 7 08:54:10 CEST 2015
I think you should bind server to an address like tcp://0.0.0.0:port otherwise, if you specify an ip address, you will accept only connection from this IP, so it should the client's address.
----- Mail original -----
> De: "Damian Allen" <pixerati at gmail.com>
> À: zeromq-dev at lists.zeromq.org
> Envoyé: Vendredi 7 Août 2015 01:46:00
> Objet: [zeromq-dev] ZeroMQ only working with local loopback
>
>
>
>
>
> Have no problems connecting server to client on the same machine.
> When I push the client to another box on the same network, any
> attempt to connect just times out. Is this a code issue or a local
> network issue? I've had no other networking issues and I have all
> firewalls turned off.
>
> Here's the code for the client and server. Like I said, these work
> fine when on the same machine using 127.0.0.1, so I don't get why
> they'd fail to connect when using the actual IP address of the
> server on separate boxes on the same network…? They'll also connect
> on the same machine if I use that machine's IP.
>
> Client (C#):
>
>
> //Initialize the client socket to the specified IPAddress and port
> NetMQSocket create_client (string ServerIPAddress, string port)
> {
> ctx = NetMQContext.Create ();
> NetMQSocket theSocket = ctx.CreateRequestSocket();
> theSocket.Connect(string.Format("tcp://{0}:{1}”,ServerIPAddress,port));
> return theSocket;
> }
>
> Server (Python):
> def _runserver(serverIPAddress, handshake_port):
> sock = zmq.Context().socket(zmq.REP)
> print("\nWaiting to bind at %s on port %s\n" % (serverIPAddress,
> handshake_port) )
> sock.bind('tcp://%s:%s' % (serverIPAddress, handshake_port) )
>
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
>
More information about the zeromq-dev
mailing list