POP connection timeout.

A

Aspersieman

Hi All

I have written an application that queries a POP mailbox and
downloads messages. When the application tries to connect to the mail
server, but takes too long (eg. longer than 60 seconds) I want to have
it time out.

Something like

try:
pop = poplib.POP3(POPHOST, POPPORT)
except someerror, err:
print "Connecting to mail box has timed out:\n", err

I know that in python 2.5 I could pass an additional timeout parameter
to the above statement ( ie: pop = poplib.POP3(POPHOST, POPPORT,
TIMEOUTINSECONDS), but I am using python 2.4.

Can anyone help me implement this timeout functionality.

Regards

Nicol
--

The three things to remember about Llamas:
1) They are harmless
2) They are deadly
3) They are made of lava, and thus nice to cuddle.





--

The three things to remember about Llamas:
1) They are harmless
2) They are deadly
3) They are made of lava, and thus nice to cuddle.
 

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,780
Messages
2,569,608
Members
45,247
Latest member
crypto tax software1

Latest Threads

Top