PyDocs

Nav

Development Tools

bind_port

  • bind_port(sock, host=HOST)
Bind the socket to a free port and return the port number. Relies on ephemeral ports in order to ensure we are using an unbound port. This is important as many tests may be running simultaneously, especially in a buildbot environment. This method raises an exception if the sock.family is AF_INET and sock.type is SOCK_STREAM, and the socket has SO_REUSEADDR or SO_REUSEPORT set on it. Tests should never set these socket options for TCP/IP sockets. The only case for setting these options is testing multicasting via multiple UDP sockets.
0 Examples
No examples for test.support.socket_helper/bind_port.
See Also
No see-alsos for test.support.socket_helper/bind_port
0 Notes
No notes for bind_port