| 1425 | super()._handle_write() |
| 1426 | |
| 1427 | def connect( |
| 1428 | self, address: Tuple, server_hostname: Optional[str] = None |
| 1429 | ) -> "Future[SSLIOStream]": |
| 1430 | self._server_hostname = server_hostname |
| 1431 | # Ignore the result of connect(). If it fails, |
| 1432 | # wait_for_handshake will raise an error too. This is |
| 1433 | # necessary for the old semantics of the connect callback |
| 1434 | # (which takes no arguments). In 6.0 this can be refactored to |
| 1435 | # be a regular coroutine. |
| 1436 | # TODO: This is trickier than it looks, since if write() |
| 1437 | # is called with a connect() pending, we want the connect |
| 1438 | # to resolve before the write. Or do we care about this? |
| 1439 | # (There's a test for it, but I think in practice users |
| 1440 | # either wait for the connect before performing a write or |
| 1441 | # they don't care about the connect Future at all) |
| 1442 | fut = super().connect(address) |
| 1443 | fut.add_done_callback(lambda f: f.exception()) |
| 1444 | return self.wait_for_handshake() |
| 1445 | |
| 1446 | def _handle_connect(self) -> None: |
| 1447 | # Call the superclass method to check for errors. |