[Mono-list] Reading from a NonBlocking socket closes the connection

Gonzalo Paniagua Javier reply.to.the.list.iam.suscribed@notexists.ximian.com
Tue, 28 Dec 2004 13:16:10 +0100


On Sun, 2004-12-26 at 15:52 -0800, scott@imeem.com wrote:
> IPEndPoint endpoint = new
> IPEndPoint(IPAddress.Parse("127.0.0.1"),80); //
> pick a destination which doesn't send data back
> Socket sock = new (Socket(endPoint,AddressFamily, SocketType.Stream,
> ProtocolType.Tcp);
> sock.Connect(endPoint);
> 
> if(sock.Connected) {
>     try {
>         sock.Blocking = false;
>         byte[] test = new byte[8];
>         sock.Receive(test);
>     }
>     catch (Exception e)
>     {
>         Console.WriteLine("Connected = " + sock.Connected);
> 
>     }
> }

This is now fixed in svn HEAD and 1-0.

Thanks.

-Gonzalo