code hangs forever until close the program for tcp call's and not throwing any exception i have tried reconnection for every email fetch
var client = new Imap4Client();
client.SendTimeout = 180000;
client.ReceiveTimeout = 300000;
client.ConnectSsl(mailServer, port );
client.LoginFast(EmailId, password);
........
try {
Mailbox mails = client.SelectMailbox(mailBox);
int Count = mails.MessageCount;
while (Count > 0 && ControlLoop && client.IsConnected)
{
... disconnect & create new TCP email login
FlagCollection fg = mails.Fetch.Flags(Count); // timeout not working
ActiveUp.Net.Mail.Message msg = mails.Fetch.MessageObject(Count); // timeout not working
IFlagCollection newfg = fg;
mails.SetFlags(Count, newfg); // timeout not working
int getuid = mails.Fetch.Uid(Count); // timeout not working
Count--;
--- ControlLoop set true for last 6 hour data only
..... save messages in DB
}
} catch(Exception ex){
.... log error
}
```