From 79c2e91d79a8c54b2f4d0ef53c8003b820092427 Mon Sep 17 00:00:00 2001 From: icedream Date: Thu, 15 May 2014 06:05:17 +0200 Subject: [PATCH] Return null on Read() if the connection is closed. I'm too lazy to fix this better for "freshly-closed" connections now. --- src/libnpsharp/RPC/RPCStream.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libnpsharp/RPC/RPCStream.cs b/src/libnpsharp/RPC/RPCStream.cs index c272639..52d17c6 100644 --- a/src/libnpsharp/RPC/RPCStream.cs +++ b/src/libnpsharp/RPC/RPCStream.cs @@ -149,7 +149,7 @@ namespace NPSharp.RPC public TRecv Read() { if (_sock == null) - throw new InvalidOperationException("You need to open the stream first."); + return null; var message = RPCMessage.Deserialize(_sock);