[Mono-dev] WCF Fail with System.Net.Sockets.SocketException: Connection reset by peer

Rob Wilkens robwilkens at gmail.com
Wed Jul 11 11:03:17 UTC 2012


On 07/11/2012 05:08 AM, Ali Shahbour wrote:
> Unhandled Exception: System.IO.IOException: Read failure --->
> System.ObjectDisposedException: The object was used after being disposed.
>   at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, Int32
> offset, Int32 size, SocketFlags flags) [0x0007e] in
> /usr/local/src/monorob/mono/mcs/class/System/System.Net.Sockets/Socket.cs:1
> 584
....
> System.ServiceModel.Channels.ReplyChannelBase.<BeginTryReceiveRequest>m__10
>  (TimeSpan tout, System.ServiceModel.Channels.RequestContext& ctx)
> [0x0002f] in 
> /usr/local/src/monorob/mono/mcs/class/System.ServiceModel/System.ServiceMod
> el.Channels/ReplyChannelBase.cs:128
>
Sorry to pollute the list, but i wanted to share:
There were places, such in ReplyChannelBase, where i was handling
SocketException and XmlException but not IOException -- because i hadn't
seen a stacktrace where that happened.

And there were places elsewhere in that same patch, which i still
haven't seen a stacktrace for but can anticipate, where i handled
IOException and XmlException, but not SocketException.  Again, i have
yet to have seen a stacktrace where this occurred, but i can anticipate
it based on the above.

I fixed it in my source (not pushed/patched yet) so Wherever IOException
is handled, SocketException is also handled -- and wherever
SocketException is handled, IOException is also handled.

By handled, I mean 'clean fail' rather than crash.

-Rob



More information about the Mono-devel-list mailing list