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

Method __init__

Lib/asyncio/selector_events.py:773–799  ·  view source on GitHub ↗
(self, loop, sock, protocol, extra=None, server=None)

Source from the content-addressed store, hash-verified

771 _sock = None
772
773 def __init__(self, loop, sock, protocol, extra=None, server=None):
774 super().__init__(extra, loop)
775 self._extra['socket'] = trsock.TransportSocket(sock)
776 try:
777 self._extra['sockname'] = sock.getsockname()
778 except OSError:
779 self._extra['sockname'] = None
780 if 'peername' not in self._extra:
781 try:
782 self._extra['peername'] = sock.getpeername()
783 except socket.error:
784 self._extra['peername'] = None
785 self._sock = sock
786 self._sock_fd = sock.fileno()
787
788 self._protocol_connected = False
789 self.set_protocol(protocol)
790
791 self._server = server
792 self._buffer = collections.deque()
793 self._conn_lost = 0 # Set when call to connection_lost scheduled.
794 self._closing = False # Set when close() called.
795 self._paused = False # Set when pause_reading() called
796
797 if self._server is not None:
798 self._server._attach(self)
799 loop._transports[self._sock_fd] = self
800
801 def __repr__(self):
802 info = [self.__class__.__name__]

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 6

set_protocolMethod · 0.95
superClass · 0.85
_attachMethod · 0.80
getsocknameMethod · 0.45
getpeernameMethod · 0.45
filenoMethod · 0.45

Tested by

no test coverage detected