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

Method __init__

Lib/test/support/smtpd.py:624–651  ·  view source on GitHub ↗
(self, localaddr, remoteaddr,
                 data_size_limit=DATA_SIZE_DEFAULT, map=None,
                 enable_SMTPUTF8=False, decode_data=False)

Source from the content-addressed store, hash-verified

622 channel_class = SMTPChannel
623
624 def __init__(self, localaddr, remoteaddr,
625 data_size_limit=DATA_SIZE_DEFAULT, map=None,
626 enable_SMTPUTF8=False, decode_data=False):
627 self._localaddr = localaddr
628 self._remoteaddr = remoteaddr
629 self.data_size_limit = data_size_limit
630 self.enable_SMTPUTF8 = enable_SMTPUTF8
631 self._decode_data = decode_data
632 if enable_SMTPUTF8 and decode_data:
633 raise ValueError("decode_data and enable_SMTPUTF8 cannot"
634 " be set to True at the same time")
635 asyncore.dispatcher.__init__(self, map=map)
636 try:
637 family = 0 if socket.has_ipv6 else socket.AF_INET
638 gai_results = socket.getaddrinfo(*localaddr, family=family,
639 type=socket.SOCK_STREAM)
640 self.create_socket(gai_results[0][0], gai_results[0][1])
641 # try to re-use a server port if possible
642 self.set_reuse_addr()
643 self.bind(localaddr)
644 self.listen(5)
645 except:
646 self.close()
647 raise
648 else:
649 print('%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
650 self.__class__.__name__, time.ctime(time.time()),
651 localaddr, remoteaddr), file=DEBUGSTREAM)
652
653 def handle_accepted(self, conn, addr):
654 print('Incoming connection from %s' % repr(addr), file=DEBUGSTREAM)

Callers

nothing calls this directly

Calls 10

set_reuse_addrMethod · 0.80
printFunction · 0.50
__init__Method · 0.45
getaddrinfoMethod · 0.45
create_socketMethod · 0.45
bindMethod · 0.45
listenMethod · 0.45
closeMethod · 0.45
ctimeMethod · 0.45
timeMethod · 0.45

Tested by

no test coverage detected