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

Method handle_stream

tornado/tcpserver.py:321–338  ·  view source on GitHub ↗

Override to handle a new `.IOStream` from an incoming connection. This method may be a coroutine; if so any exceptions it raises asynchronously will be logged. Accepting of incoming connections will not be blocked by this coroutine. If this `TCPServer` is configured

(
        self, stream: IOStream, address: tuple
    )

Source from the content-addressed store, hash-verified

319 sock.close()
320
321 def handle_stream(
322 self, stream: IOStream, address: tuple
323 ) -> Optional[Awaitable[None]]:
324 """Override to handle a new `.IOStream` from an incoming connection.
325
326 This method may be a coroutine; if so any exceptions it raises
327 asynchronously will be logged. Accepting of incoming connections
328 will not be blocked by this coroutine.
329
330 If this `TCPServer` is configured for SSL, ``handle_stream``
331 may be called before the SSL handshake has completed. Use
332 `.SSLIOStream.wait_for_handshake` if you need to verify the client's
333 certificate or use NPN/ALPN.
334
335 .. versionchanged:: 4.2
336 Added the option for this method to be a coroutine.
337 """
338 raise NotImplementedError()
339
340 def _handle_connection(self, connection: socket.socket, address: Any) -> None:
341 if self.ssl_options is not None:

Callers 1

_handle_connectionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected