[zeromq-dev] [PATCH] Moved tests off 5555 (conflict with Eclipse)

Daniel Holth dholth at gmail.com
Tue May 10 20:12:24 CEST 2011

'binding' to an OS assigned port, in Python, as an alternative to random().
bind() is not used.

from socket import *
s = socket(AF_INET, INADDR_ANY) # preferably only listen on localhost
ip, port = s.getsockname()
>>> ('', 34232) # the port chosen by the OS
connection = s.accept()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20110510/d8d4f263/attachment.htm>

More information about the zeromq-dev mailing list