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

Method wait_for_handshake

python/python3/tornado/iostream.py:1533–1563  ·  view source on GitHub ↗

Wait for the initial SSL handshake to complete. If a ``callback`` is given, it will be called with no arguments once the handshake is complete; otherwise this method returns a `.Future` which will resolve to the stream itself after the handshake is complete.

(self)

Source from the content-addressed store, hash-verified

1531 self._add_io_state(old_state)
1532
1533 def wait_for_handshake(self) -> "Future[SSLIOStream]":
1534 """Wait for the initial SSL handshake to complete.
1535
1536 If a ``callback`` is given, it will be called with no
1537 arguments once the handshake is complete; otherwise this
1538 method returns a `.Future` which will resolve to the
1539 stream itself after the handshake is complete.
1540
1541 Once the handshake is complete, information such as
1542 the peer's certificate and NPN/ALPN selections may be
1543 accessed on ``self.socket``.
1544
1545 This method is intended for use on server-side streams
1546 or after using `IOStream.start_tls`; it should not be used
1547 with `IOStream.connect` (which already waits for the
1548 handshake to complete). It may only be called once per stream.
1549
1550 .. versionadded:: 4.2
1551
1552 .. versionchanged:: 6.0
1553
1554 The ``callback`` argument was removed. Use the returned
1555 `.Future` instead.
1556
1557 """
1558 if self._ssl_connect_future is not None:
1559 raise RuntimeError("Already waiting")
1560 future = self._ssl_connect_future = Future()
1561 if not self._ssl_accepting:
1562 self._finish_ssl_connect()
1563 return future
1564
1565 def write_to_fd(self, data: memoryview) -> int:
1566 # clip buffer size at 1GB since SSL sockets only support upto 2GB

Callers 3

connectMethod · 0.95
handle_connectionMethod · 0.80
handle_streamMethod · 0.80

Calls 1

_finish_ssl_connectMethod · 0.95

Tested by 2

handle_connectionMethod · 0.64
handle_streamMethod · 0.64