Hi,

I am writing an IMAP client and would like to be able to detect if my
IMAP stream is still alive before using it. I do not want to call
mail_open() all the time to make sure I have a valid stream. Also, I
don't keep a stream but rather a stream handle.

The best way I have found so far is to do a mail_ping() at regular
interval (currently 5 seconds), if the connection is dead, I will
receive a notification which I can use to set a flag to indicate the
stream is dead. Now before executing a "command", I get the stream from
my stream handle and check if the flag I set during notification has not
been set.

The problem with this method is that the mail_ping() function send a an
IMAP command to the server and therefore the application has to wait for
the reply. Also, I cannot detect if the stream dye between a ping and
the real command!

I am wondering is there is a way to detect in real time when the IMAP
connection drop, and this without generating traffic?

Thanks for your help,
Jean-Francois Ducarroz


_______________________________________________
Imap-uw mailing list
[email protected]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to