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

Method connection_lost

Lib/asyncio/sslproto.py:393–427  ·  view source on GitHub ↗

Called when the low-level connection is lost or closed. The argument is an exception object or None (the latter meaning a regular EOF is received or the connection was aborted or closed).

(self, exc)

Source from the content-addressed store, hash-verified

391 self._start_handshake()
392
393 def connection_lost(self, exc):
394 """Called when the low-level connection is lost or closed.
395
396 The argument is an exception object or None (the latter
397 meaning a regular EOF is received or the connection was
398 aborted or closed).
399 """
400 self._write_backlog.clear()
401 self._outgoing.read()
402 self._conn_lost += 1
403
404 # Just mark the app transport as closed so that its __dealloc__
405 # doesn't complain.
406 if self._app_transport is not None:
407 self._app_transport._closed = True
408
409 if self._state != SSLProtocolState.DO_HANDSHAKE:
410 if (
411 self._app_state == AppProtocolState.STATE_CON_MADE or
412 self._app_state == AppProtocolState.STATE_EOF
413 ):
414 self._app_state = AppProtocolState.STATE_CON_LOST
415 self._loop.call_soon(self._app_protocol.connection_lost, exc)
416 self._set_state(SSLProtocolState.UNWRAPPED)
417 self._transport = None
418 self._app_transport = None
419 self._app_protocol = None
420 self._wakeup_waiter(exc)
421
422 if self._shutdown_timeout_handle:
423 self._shutdown_timeout_handle.cancel()
424 self._shutdown_timeout_handle = None
425 if self._handshake_timeout_handle:
426 self._handshake_timeout_handle.cancel()
427 self._handshake_timeout_handle = None
428
429 def get_buffer(self, n):
430 want = n

Callers 5

_call_connection_lostMethod · 0.45
_call_connection_lostMethod · 0.45
_call_connection_lostMethod · 0.45
pipe_connection_lostMethod · 0.45
_call_connection_lostMethod · 0.45

Calls 6

_set_stateMethod · 0.95
_wakeup_waiterMethod · 0.95
clearMethod · 0.45
readMethod · 0.45
call_soonMethod · 0.45
cancelMethod · 0.45

Tested by

no test coverage detected