Skip to content
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 "The write operation failed, see inner exception." on ImapClient #70

Open
kostaswonga opened this issue Apr 24, 2012 · 1 comment

Comments

@kostaswonga
Copy link

Inner exception is of type SystemObjectDisposedException with message : "Cannot access a disposed object. Object name: 'System.Net.Sockets.NetworkStream'"

This happens when I dispose the ImapClient object in my class destructor like so:

~EmailAddress()
{
if(_client != null && !_client.IsDisposed)
_client.Dispose();
}

It seems to be some kind of race condition given that some times it succeeds and others(especially when I have a break point on it for a couple of seconds) it fails.

Full stack trace from outer exception:
at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at AE.Net.Mail.TextClient.SendCommand(String command)
at AE.Net.Mail.ImapClient.OnLogout()
at AE.Net.Mail.TextClient.Logout()
at AE.Net.Mail.TextClient.Disconnect()
at AE.Net.Mail.TextClient.Dispose(Boolean disposing)
at AE.Net.Mail.TextClient.Dispose()

Stack trace from inner exception:
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)

andyedinborough added a commit that referenced this issue May 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@kostaswonga and others