MCPcopy Create free account
hub / github.com/EasyIME/PIME / connect

Method connect

python/python3/tornado/iostream.py:1486–1503  ·  view source on GitHub ↗
(
        self, address: Tuple, server_hostname: Optional[str] = None
    )

Source from the content-addressed store, hash-verified

1484 super()._handle_write()
1485
1486 def connect(
1487 self, address: Tuple, server_hostname: Optional[str] = None
1488 ) -> "Future[SSLIOStream]":
1489 self._server_hostname = server_hostname
1490 # Ignore the result of connect(). If it fails,
1491 # wait_for_handshake will raise an error too. This is
1492 # necessary for the old semantics of the connect callback
1493 # (which takes no arguments). In 6.0 this can be refactored to
1494 # be a regular coroutine.
1495 # TODO: This is trickier than it looks, since if write()
1496 # is called with a connect() pending, we want the connect
1497 # to resolve before the write. Or do we care about this?
1498 # (There's a test for it, but I think in practice users
1499 # either wait for the connect before performing a write or
1500 # they don't care about the connect Future at all)
1501 fut = super().connect(address)
1502 fut.add_done_callback(lambda f: f.exception())
1503 return self.wait_for_handshake()
1504
1505 def _handle_connect(self) -> None:
1506 # Call the superclass method to check for errors.

Callers 1

connect_to_serverMethod · 0.95

Calls 2

wait_for_handshakeMethod · 0.95
connectMethod · 0.45

Tested by 1

connect_to_serverMethod · 0.76