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

Method get_backlog

gunicorn/sock.py:98–109  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

96
97 if PLATFORM == "linux":
98 def get_backlog(self):
99 if self.sock:
100 # tcp_info struct from include/uapi/linux/tcp.h
101 fmt = 'B' * 8 + 'I' * 24
102 try:
103 tcp_info_struct = self.sock.getsockopt(socket.IPPROTO_TCP,
104 socket.TCP_INFO, 104)
105 # 12 is tcpi_unacked
106 return struct.unpack(fmt, tcp_info_struct)[12]
107 except (AttributeError, OSError):
108 pass
109 return 0
110 else:
111 def get_backlog(self):
112 return -1

Callers 1

manage_workersMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected