MCPcopy Index your code
hub / github.com/python/cpython / close

Method close

Lib/http/client.py:1039–1051  ·  view source on GitHub ↗

Close the connection to the HTTP server.

(self)

Source from the content-addressed store, hash-verified

1037 self._tunnel()
1038
1039 def close(self):
1040 """Close the connection to the HTTP server."""
1041 self.__state = _CS_IDLE
1042 try:
1043 sock = self.sock
1044 if sock:
1045 self.sock = None
1046 sock.close() # close it manually... there may be other refs
1047 finally:
1048 response = self.__response
1049 if response:
1050 self.__response = None
1051 response.close()
1052
1053 def send(self, data):
1054 """Send 'data' to the server.

Callers 8

_tunnelMethod · 0.95
getresponseMethod · 0.95
test_http_clientFunction · 0.95
test_response_filenoMethod · 0.95
testTimeoutAttributeMethod · 0.95
run_clientMethod · 0.95

Calls 1

closeMethod · 0.45

Tested by 6

test_http_clientFunction · 0.76
test_response_filenoMethod · 0.76
testTimeoutAttributeMethod · 0.76
run_clientMethod · 0.76