This project is read-only.

How to check if client connected

Aug 30, 2013 at 3:02 PM

I have got a problem. When my Application not used about 30 minutes, It will crash.
public static int GetMessageCount(Imap4Client client)
            int msgCount = 0;
            Mailbox inbox = client.SelectMailbox(EmailInboxFolder);            
            return inbox.MessageCount;
Problem is with Mailbox inbox = client.SelectMailbox(EmailInboxFolder);

Client has got property IsConnected, but it is totaly untrust. Sometimes is true, sometimes is false. Have You got any idea, how to check if client is connected? Maybe use some property, timer witch checking, handler, or I do not know......
Sep 8, 2013 at 9:30 AM
Use NOOP to prevent the connection from reaching timeout. Run a timer that will call client.noop() every 25 mins.