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