Only throw errors in reading loop in Debug builds.

feature-npv2
Icedream 2014-05-15 06:06:59 +02:00
parent 96d4e1f778
commit 301281737c
1 changed files with 13 additions and 2 deletions

View File

@ -570,12 +570,23 @@ namespace NPSharp
#endif
_log.Debug("Client connected");
OnClientConnected(client);
#if !DEBUG
try
#endif
{
while (true)
{
var msg = client.RPC.Read();
if (msg == null)
break;
}
}
#if !DEBUG
catch (Exception error)
{
_log.Error("Error in RPC read loop", error);
}
#endif
_log.Debug("Client disconnected");
OnClientDisconnected(client);
#if !DEBUG