MCPcopy Create free account
hub / github.com/ActiveState/code / __init__

Function __init__

recipes/Python/576574_Login_Logger/recipe-576574.py:38–46  ·  view source on GitHub ↗

Binds the server to the given port.

(self, port)

Source from the content-addressed store, hash-verified

36
37
38 def __init__(self, port):
39 "Binds the server to the given port."
40
41 self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
42 self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
43 self.socket.bind(port)
44
45 #Queue up to five requests before turning clients away.
46 self.socket.listen(5)
47
48
49 def run(self):

Callers 1

recipe-576374.pyFile · 0.50

Calls 4

socketMethod · 0.80
setsockoptMethod · 0.45
bindMethod · 0.45
listenMethod · 0.45

Tested by

no test coverage detected