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)
| 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 |
no test coverage detected