MCPcopy
hub / github.com/tornadoweb/tornado / __init__

Method __init__

tornado/iostream.py:1329–1350  ·  view source on GitHub ↗

The ``ssl_options`` keyword argument may either be an `ssl.SSLContext` object or a dictionary of keywords arguments for `ssl.SSLContext.wrap_socket`

(self, *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

1327 socket = None # type: ssl.SSLSocket
1328
1329 def __init__(self, *args: Any, **kwargs: Any) -> None:
1330 """The ``ssl_options`` keyword argument may either be an
1331 `ssl.SSLContext` object or a dictionary of keywords arguments
1332 for `ssl.SSLContext.wrap_socket`
1333 """
1334 self._ssl_options = kwargs.pop("ssl_options", _client_ssl_defaults)
1335 super().__init__(*args, **kwargs)
1336 self._ssl_accepting = True
1337 self._handshake_reading = False
1338 self._handshake_writing = False
1339 self._server_hostname = None # type: Optional[str]
1340
1341 # If the socket is already connected, attempt to start the handshake.
1342 try:
1343 self.socket.getpeername()
1344 except OSError:
1345 pass
1346 else:
1347 # Indirectly start the handshake, which will run on the next
1348 # IOLoop iteration and then the real IO state will be set in
1349 # _handle_events.
1350 self._add_io_state(self.io_loop.WRITE)
1351
1352 def reading(self) -> bool:
1353 return self._handshake_reading or super().reading()

Callers

nothing calls this directly

Calls 2

_add_io_stateMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected