MCPcopy
hub / github.com/tornadoweb/tornado / test_reuse_port

Method test_reuse_port

tornado/test/netutil_test.py:201–210  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

199 not hasattr(socket, "SO_REUSEPORT"), "SO_REUSEPORT is not supported"
200 )
201 def test_reuse_port(self):
202 sockets: typing.List[socket.socket] = []
203 sock, port = bind_unused_port(reuse_port=True)
204 try:
205 sockets = bind_sockets(port, "127.0.0.1", reuse_port=True)
206 self.assertTrue(all(s.getsockname()[1] == port for s in sockets))
207 finally:
208 sock.close()
209 for sock in sockets:
210 sock.close()

Callers

nothing calls this directly

Calls 4

bind_unused_portFunction · 0.90
bind_socketsFunction · 0.90
allFunction · 0.85
closeMethod · 0.45

Tested by

no test coverage detected