MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / __init__

Method __init__

tools/python-3.11.9-amd64/Lib/smtpd.py:635–661  ·  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

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

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected