MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / connect

Method connect

tools/python-3.11.9-amd64/Lib/http/client.py:959–972  ·  view source on GitHub ↗

Connect to the host and port specified in __init__.

(self)

Source from the content-addressed store, hash-verified

957 response.close()
958
959 def connect(self):
960 """Connect to the host and port specified in __init__."""
961 sys.audit("http.client.connect", self, self.host, self.port)
962 self.sock = self._create_connection(
963 (self.host,self.port), self.timeout, self.source_address)
964 # Might fail in OSs that don't implement TCP_NODELAY
965 try:
966 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
967 except OSError as e:
968 if e.errno != errno.ENOPROTOOPT:
969 raise
970
971 if self._tunnel_host:
972 self._tunnel()
973
974 def close(self):
975 """Close the connection to the HTTP server."""

Callers 7

sendMethod · 0.95
connectMethod · 0.45
makeSocketMethod · 0.45
_connect_unixsocketMethod · 0.45
createSocketMethod · 0.45
server_activateMethod · 0.45
initMethod · 0.45

Calls 2

_tunnelMethod · 0.95
setsockoptMethod · 0.80

Tested by

no test coverage detected