MCPcopy Index your code
hub / github.com/RustPython/RustPython / connect

Method connect

Lib/http/client.py:1020–1033  ·  view source on GitHub ↗

Connect to the host and port specified in __init__.

(self)

Source from the content-addressed store, hash-verified

1018 )
1019
1020 def connect(self):
1021 """Connect to the host and port specified in __init__."""
1022 sys.audit("http.client.connect", self, self.host, self.port)
1023 self.sock = self._create_connection(
1024 (self.host,self.port), self.timeout, self.source_address)
1025 # Might fail in OSs that don't implement TCP_NODELAY
1026 try:
1027 self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
1028 except OSError as e:
1029 if e.errno != errno.ENOPROTOOPT:
1030 raise
1031
1032 if self._tunnel_host:
1033 self._tunnel()
1034
1035 def close(self):
1036 """Close the connection to the HTTP server."""

Callers 9

sendMethod · 0.95
testTimeoutAttributeMethod · 0.95
connectMethod · 0.45
mainFunction · 0.45
makeSocketMethod · 0.45
_connect_unixsocketMethod · 0.45
createSocketMethod · 0.45
__init__Method · 0.45
initMethod · 0.45

Calls 3

_tunnelMethod · 0.95
_create_connectionMethod · 0.80
setsockoptMethod · 0.45

Tested by 1

testTimeoutAttributeMethod · 0.76