I totally agree with you, 5 seconds is way too short.

Here is what I am trying to achieve:

I open the connection using mail_open, do couple IMAP operations like fetching new mail. Everything goes well as expected. I am done for know but I keep the IMAP connection open for performance purpose. 30 seconds later, I execute a another IMAP command but the connection did drop since last time I used it therefore the command failed! Personally, I would like to be able to detect if my connection is still alive before executing any IMAP command, if it's not open, I can try to open it first.

The simplest solution to that problem is to always call mail_open before doing anything rather than "holding" the stream but this solution as performance issue. Would it be another better and more elegant way to achieve that?

Jean-François

Mark Crispin wrote:
mail_ping() is, indeed, the correct way to determine is a stream is alive. The only way to know if a stream is still alive is to use it.

5 seconds is, however, a rather small interval. I recommend at least 60 seconds, and more commonly 150 seconds. In fact, you want to do this in order to get new mail notifications.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.

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

Reply via email to