472,129 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,129 software developers and data experts.

non-blocking communication with imaplib


Hi,
I was wondering if anyone had a suggestion for the following issue. I
would like to talk to an IMAP-server, imaplib being the tool of
choice, of course. Unfortunately it may happen that the IMAP-server
fails to respond to certain commands, and I would like to be able to
detect that within a given time period (on the scale of 5-10 seconds).

Initially, I thought about playing with setsockblocking() for the
communication socket in the imaplib.IMAP4 object. However, the IMAP4
object uses a file object ("created from" the said socket), and the
underlying socket must be blocking according to [1].

Is there another option for detecting when the server fails to reply
within a given time slot? Could I perhaps temporarily set the socket
to non-blocking mode? Or maybe I am attacking this problem the wrong
way altogether?

Any hints would be greatly appreciated.

TIA,

ivr
[1] <http://docs.python.org/lib/socket-objects.html#l2h-3693>
--
<+Kaptein-Dahigorr: for få parenteser
<+Kaptein-Dahigorr: parenteser virker som lubrication under iterasjon
<+Kaptein-Dahigorr: velkjent
Aug 22 '07 #1
0 986

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by lothar | last post: by
25 posts views Thread by Yves Glodt | last post: by
32 posts views Thread by Adrian Herscu | last post: by
8 posts views Thread by Bern McCarty | last post: by
14 posts views Thread by Patrick Kowalzick | last post: by
399 posts views Thread by =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.