socket and thread

Z

ZeeGeek

I'm writing a small program which uses different threads to monitor an
IMAP mailbox and an RSS feed. If network is not available when the
program starts, both threads will sleep for a while and try again. It
seems that the first thread succeeds when the network becomes
available will cause the other thread to always give a gaierror "No
address associated with hostname". The weird thing is that this only
happens when the program starts with network unavailable. If network
is available when the program starts, both threads work well, even if
the network drops in the middle, the threads can recover properly when
the network comes back alive. Is Python socket thread-unsafe or is it
because of some other problems?

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,787
Messages
2,569,627
Members
45,328
Latest member
66Teonna9

Latest Threads

Top