(
self,
start_line: Union[httputil.RequestStartLine, httputil.ResponseStartLine],
headers: httputil.HTTPHeaders,
)
| 1505 | ) |
| 1506 | |
| 1507 | async def headers_received( |
| 1508 | self, |
| 1509 | start_line: Union[httputil.RequestStartLine, httputil.ResponseStartLine], |
| 1510 | headers: httputil.HTTPHeaders, |
| 1511 | ) -> None: |
| 1512 | assert isinstance(start_line, httputil.ResponseStartLine) |
| 1513 | if start_line.code != 101: |
| 1514 | await super().headers_received(start_line, headers) |
| 1515 | return |
| 1516 | |
| 1517 | if self._timeout is not None: |
| 1518 | self.io_loop.remove_timeout(self._timeout) |
| 1519 | self._timeout = None |
| 1520 | |
| 1521 | self.headers = headers |
| 1522 | self.protocol = self.get_websocket_protocol() |
| 1523 | self.protocol._process_server_headers(self.key, self.headers) |
| 1524 | self.protocol.stream = self.connection.detach() |
| 1525 | |
| 1526 | IOLoop.current().add_callback(self.protocol._receive_frame_loop) |
| 1527 | self.protocol.start_pinging() |
| 1528 | |
| 1529 | # Once we've taken over the connection, clear the final callback |
| 1530 | # we set on the http request. This deactivates the error handling |
| 1531 | # in simple_httpclient that would otherwise interfere with our |
| 1532 | # ability to see exceptions. |
| 1533 | self.final_callback = None # type: ignore |
| 1534 | |
| 1535 | future_set_result_unless_cancelled(self.connect_future, self) |
| 1536 | |
| 1537 | def write_message( |
| 1538 | self, message: Union[str, bytes, Dict[str, Any]], binary: bool = False |
nothing calls this directly
no test coverage detected