MCPcopy Index your code
hub / github.com/RustPython/RustPython / connect_accepted_socket

Method connect_accepted_socket

Lib/asyncio/base_events.py:1661–1688  ·  view source on GitHub ↗
(
            self, protocol_factory, sock,
            *, ssl=None,
            ssl_handshake_timeout=None,
            ssl_shutdown_timeout=None)

Source from the content-addressed store, hash-verified

1659 return server
1660
1661 async def connect_accepted_socket(
1662 self, protocol_factory, sock,
1663 *, ssl=None,
1664 ssl_handshake_timeout=None,
1665 ssl_shutdown_timeout=None):
1666 if sock.type != socket.SOCK_STREAM:
1667 raise ValueError(f'A Stream Socket was expected, got {sock!r}')
1668
1669 if ssl_handshake_timeout is not None and not ssl:
1670 raise ValueError(
1671 'ssl_handshake_timeout is only meaningful with ssl')
1672
1673 if ssl_shutdown_timeout is not None and not ssl:
1674 raise ValueError(
1675 'ssl_shutdown_timeout is only meaningful with ssl')
1676
1677 _check_ssl_socket(sock)
1678
1679 transport, protocol = await self._create_connection_transport(
1680 sock, protocol_factory, ssl, '', server_side=True,
1681 ssl_handshake_timeout=ssl_handshake_timeout,
1682 ssl_shutdown_timeout=ssl_shutdown_timeout)
1683 if self._debug:
1684 # Get the socket from the transport because SSL transport closes
1685 # the old socket and creates a new SSL socket
1686 sock = transport.get_extra_info('socket')
1687 logger.debug("%r handled: (%r, %r)", sock, transport, protocol)
1688 return transport, protocol
1689
1690 async def connect_read_pipe(self, protocol_factory, pipe):
1691 protocol = protocol_factory()

Callers

nothing calls this directly

Calls 4

_check_ssl_socketFunction · 0.85
get_extra_infoMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected