G
Gordon Messmer
According to the "signal" documentation, threads spawned as part of a
multi-threaded application can not receive signals.
I have a daemon which I want to validate email addresses by connecting
to the MX for the domain and sending the EHLO/MAIL/RCPT commands. I
would like to place an upper limit on the amount of time spent doing the
validation. I had expected to be able to schedule an alarm() in a
thread, and use that to interrupt the otherwise blocking read/writes.
What's the easiest way to accomplish that? Should I just subclass
smtplib's SMTP class and override the "connect" function with one that
creates a socket with a timeout?
multi-threaded application can not receive signals.
I have a daemon which I want to validate email addresses by connecting
to the MX for the domain and sending the EHLO/MAIL/RCPT commands. I
would like to place an upper limit on the amount of time spent doing the
validation. I had expected to be able to schedule an alarm() in a
thread, and use that to interrupt the otherwise blocking read/writes.
What's the easiest way to accomplish that? Should I just subclass
smtplib's SMTP class and override the "connect" function with one that
creates a socket with a timeout?