public object ReadNonBlocking() { // Make only the first read non-blocking. // With current unmarshaling code it will // be hard to recover from the case when // some data have already been read and then // comes a WSAEWOULDBLOCK SocketException. // So it won't work if we do just this: // socket.Blocking = false; #if DEBUG_IO tcp_stream.SetOneShotNonBlocking(); #else stream.SetOneShotNonBlocking(); #endif return(Read()); }