I am following some example code to use asyncore
here, only having set a timeout
value for asyncore.loop
as in the following full example:
import smtpd
import asyncore
class CustomSMTPServer(smtpd.SMTPServer):
def process_message(self, peer, mailfrom, rcpttos, data):
print 'Receiving message from:', peer
print 'Message addressed from:', mailfrom
print 'Message addressed to :', rcpttos
print 'Message length :', len(data)
return
server = CustomSMTPServer(('127.0.0.1', 1025), None)
asyncore.loop(timeout = 1)
I have expected that a timeout occurs after 1 second, but this is not the case. The code runs much longer for than one second. What am I missing here?
asyncore.loop()
does not end the functionasyncore.loop()
after the specified time. – Ftlbtimeout
does, 3) asyncore is not using the specified timeout with select 4) there are open channels .. I suspect it will end shortly if a count (say, 2) is specified. If that is indeed the case then #2 and #3 can likely be ruled out. – Conaltimeout
argument inasyncore.loop()
? – Ftlb