Closed Sicos1977 closed 9 years ago
Nope, it doesn't use tasks. It's probably just network slowness. All it does is call Socket.Connect().
Isn't this code using tasks?
try {
cancellationToken.ThrowIfCancellationRequested ();
socket.Connect (ipAddresses[i], port);
break;
} catch (OperationCanceledException) {
socket.Dispose ();
throw;
} catch {
socket.Dispose ();
if (i + 1 == ipAddresses.Length)
throw;
}
No. Where do you see tasks? It's using a CancellationToken, but that is not a task.
The cancellation token was my mistake... but still got a problem... this is the connect logging that I have logged with the protocollogger. Any ideas why I can't get a list of messages?
The log is written from the exception handler that I did put around the code
Connected to imaps://server:993/ S: * OK The IMAP4 service is ready. C: A00000000 CAPABILITY S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN UIDPLUS MOVE ID CHILDREN IDLE NAMESPACE LITERAL+ S: A00000000 OK CAPABILITY completed.
Looks like the authentication process hasn't completed. MailKit looks to be waiting for the server to respond.
And this is the logging when I run it from visual studio.
Connected to imaps://server:993/ C: A00000000 CAPABILITY S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN UIDPLUS MOVE ID CHILDREN IDLE NAMESPACE LITERAL+ S: A00000000 OK CAPABILITY completed. C: A00000001 AUTHENTICATE PLAIN S: + C: .... <base 64 encoded password string> S: A00000001 OK AUTHENTICATE completed. C: A00000002 CAPABILITY S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN UIDPLUS MOVE ID CHILDREN IDLE NAMESPACE LITERAL+ S: A00000002 OK CAPABILITY completed. C: A00000003 NAMESPACE S: * NAMESPACE (("" "/")) NIL NIL S: A00000003 OK NAMESPACE completed. C: A00000004 LIST "" "INBOX" S: * LIST (\Marked \HasNoChildren) "/" INBOX S: A00000004 OK LIST completed. C: A00000005 EXAMINE INBOX S: * 0 EXISTS S: * 0 RECENT S: * FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent) S: * OK [PERMANENTFLAGS ()] Permanent flags S: * OK [UIDVALIDITY 14] UIDVALIDITY value S: * OK [UIDNEXT 20] The next unique identifier value S: A00000005 OK [READ-ONLY] EXAMINE completed. C: A00000006 LOGOUT
Yep, this is the line that MailKit is waiting for in your previous comment:
S: +
According to the first log, the server is not sending it.
Well... just don't understand why this works on my development server and fails on my deployment server. I even did set off the firewall but that doesn't make any difference at all
Server load? Network congestion? Some sort of proxy?
Uhm... forget everything... It seems that there is a problem with the domain controllers inside the company where I'm working... and since this is a very big company (16.000+ people) they forgot to tell us that there is a problem... sigh...
And off course my development platform is on another domain controller then my deployment server Thanks for the help anyway
Hi,
I have a question about the code below. Does the client.Connect method use Tasks? And if so is it then possible that this sometimes can take forever to complete because I use a lot of tasks on the same system? The reason why I ask this is that the client.Connect method sometimes takes forever to complete. When I run the code from Visual Studio then it runs as expected. It only gives problems when it is deployed on a Windows 2012 R2 IIS 8.5 system.