Search code examples
zeromq

what does tcp:*:port mean in zeromq?


I see this sort of address used in a bunch of examples. What does it mean exactly? Does it mean it will connect to any/all machines on the subnet that have something listening to that port? Or something else entirely? I see such usage in the docs and in books without explanation. Sort of annoying.


Solution

  • It is explained in the manual.

    ZeroMQ supports multiple transports. tcp means you are using the TCP transport.

    The address (or endpoint) for the TCP transport has the following format:

    tcp://interface:port
    

    When you bind to a local address, interface is either the IP address of a specific interface (network) or *, which means to listen on all interfaces (networks). port is the TCP port or * for a random port.

    When you connect to a remote endpoint, interface is the hostname or IP address of the remote machine. port is the TCP port of the remote endpoint.