MCPcopy Create free account
hub / github.com/InternScience/SciReason / HTTPAdapterWithSocketOptions

Class HTTPAdapterWithSocketOptions

opencompass/models/bailing_api_oc.py:26–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25
26class HTTPAdapterWithSocketOptions(HTTPAdapter):
27
28 def __init__(self, *args, **kwargs):
29 self._socket_options = HTTPConnection.default_socket_options + [
30 (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1),
31 (socket.SOL_TCP, socket.TCP_KEEPIDLE, 75),
32 (socket.SOL_TCP, socket.TCP_KEEPINTVL, 30),
33 (socket.SOL_TCP, socket.TCP_KEEPCNT, 120),
34 ]
35 super(HTTPAdapterWithSocketOptions, self).__init__(*args, **kwargs)
36
37 def init_poolmanager(self, *args, **kwargs):
38 if self._socket_options is not None:
39 kwargs['socket_options'] = self._socket_options
40 super(HTTPAdapterWithSocketOptions,
41 self).init_poolmanager(*args, **kwargs)
42
43
44class BailingAPI(BaseAPIModel):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected