-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOException #80
Comments
I also have this issue! |
Hello I am having the same problem. It seems commenting out stream.ReadTimeout = 10000 in Utilities.cs fixes the problem. I wouldn't know why it times out in the first place though, 10000ms seems like a reasonable timeout value... |
I believe the problem is that ReadToEnd is being called on the network stream (for instance in the MailMessage Load method), which is then setting the read timeout value to 10000ms. The timeout would then be triggered when the client goes into IDLE mode waiting on the socket to receive notifications from the server. What's the purpose of setting a ReadTimeout value in the first place in the ReadToEnd and ReadLine methods? |
I tried smiley22's fix -- I commented out the lines that set the timeout to 10000, it worked for a few minutes. |
I am also having this issue. If I try with fix mentioned by smiley22 I get: Exception of type 'System.OutOfMemoryException' was thrown. Utilities.cs line 27. mem.WriteByte(b); |
I have a problem as zlaja |
My code: This code run with no problem on my home machine but when I run it on another machine which have a connection to proxy server, it's not work. I'm not sure the problem is due to proxy or not but it may be a clue. Anyone get the same situation? |
+1
That didn't work for me :( |
+1 |
Found this issue (so far, only just started) in Hotmail changed timeout to -1 as above and that worked for me. |
Code:
var imap = new ImapClient("imap.gmail.com", "[email protected]", "pwd", AE.Net.Mail.ImapClient.AuthMethods.Login, 993, true);
imap.NewMessage += (sender, e) =>
{
var newMsg = imap.GetMessage(e.MessageCount - 1);
Console.WriteLine("Total email: {0}, current subject {1}.", e.MessageCount, newMsg.Subject);
};
After the NewMessage event is triggered, it'll later get an exception:
System.IO.IOException was unhandled
Message=Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Source=System
StackTrace:
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security.SslStream.Read(Byte[] buffer, Int32 offset, Int32 count)
at System.IO.Stream.ReadByte()
at AE.Net.Mail.TextClient.GetResponse() in C:\Users\elviny\Desktop\andyedinborough-aenetmail-7ed7bf1\TextClient.cs:line 106
at AE.Net.Mail.ImapClient.<>c__DisplayClass4.b__3(Object _) in C:\Users\elviny\Desktop\andyedinborough-aenetmail-7ed7bf1\ImapClient.cs:line 135
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
InnerException: System.Net.Sockets.SocketException
Message=A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Source=System
ErrorCode=10060
NativeErrorCode=10060
StackTrace:
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
InnerException:
Inner exception: {"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"}
Stack:
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
The text was updated successfully, but these errors were encountered: