Return null on Read() if the connection is closed. I'm too lazy to fix this better for "freshly-closed" connections now.

feature-npv2
Icedream 2014-05-15 06:05:17 +02:00
parent df9c59a19e
commit 79c2e91d79
1 changed files with 1 additions and 1 deletions

View File

@ -149,7 +149,7 @@ namespace NPSharp.RPC
public TRecv Read() public TRecv Read()
{ {
if (_sock == null) if (_sock == null)
throw new InvalidOperationException("You need to open the stream first."); return null;
var message = RPCMessage.Deserialize<TRecv>(_sock); var message = RPCMessage.Deserialize<TRecv>(_sock);