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

Method close

tools/python-3.11.9-amd64/Lib/poplib.py:283–304  ·  view source on GitHub ↗

Close the connection without assuming anything about it.

(self)

Source from the content-addressed store, hash-verified

281 return resp
282
283 def close(self):
284 """Close the connection without assuming anything about it."""
285 try:
286 file = self.file
287 self.file = None
288 if file is not None:
289 file.close()
290 finally:
291 sock = self.sock
292 self.sock = None
293 if sock is not None:
294 try:
295 sock.shutdown(socket.SHUT_RDWR)
296 except OSError as exc:
297 # The server might already have closed the connection.
298 # On Windows, this may result in WSAEINVAL (error 10022):
299 # An invalid operation was attempted.
300 if (exc.errno != errno.ENOTCONN
301 and getattr(exc, 'winerror', 0) != 10022):
302 raise
303 finally:
304 sock.close()
305
306 #__del__ = quit
307

Callers 1

quitMethod · 0.95

Calls 1

shutdownMethod · 0.45

Tested by

no test coverage detected