MCPcopy
hub / github.com/benoitc/gunicorn / connect

Method connect

gunicorn/dirty/client.py:59–78  ·  view source on GitHub ↗

Establish sync socket connection to arbiter. Raises: DirtyConnectionError: If connection fails

(self)

Source from the content-addressed store, hash-verified

57 # -------------------------------------------------------------------------
58
59 def connect(self):
60 """
61 Establish sync socket connection to arbiter.
62
63 Raises:
64 DirtyConnectionError: If connection fails
65 """
66 if self._sock is not None:
67 return
68
69 try:
70 self._sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
71 self._sock.settimeout(self.timeout)
72 self._sock.connect(self.socket_path)
73 except (socket.error, OSError) as e:
74 self._sock = None
75 raise DirtyConnectionError(
76 f"Failed to connect to dirty arbiter: {e}",
77 socket_path=self.socket_path
78 ) from e
79
80 def execute(self, app_path, action, *args, **kwargs):
81 """

Callers 11

_execute_lockedMethod · 0.95
__enter__Method · 0.95
test_connect_successMethod · 0.95
worker_taskMethod · 0.95
sd_notifyFunction · 0.45
_start_requestMethod · 0.45
_connectMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
create_h2_connectionFunction · 0.45

Calls 2

settimeoutMethod · 0.45

Tested by 3

test_connect_successMethod · 0.76
create_h2_connectionFunction · 0.36