mirror of https://github.com/icedream/npsharp.git
move Disconnect() out of exception handlers in NPClient to allow graceful disconnection to work
parent
58a5e8049d
commit
0b1ecee3d1
|
@ -91,15 +91,14 @@ namespace NPSharp.NP
|
||||||
catch (ProtocolViolationException error)
|
catch (ProtocolViolationException error)
|
||||||
{
|
{
|
||||||
_log.ErrorFormat("Protocol violation: {0}. Disconnect imminent.", error.Message);
|
_log.ErrorFormat("Protocol violation: {0}. Disconnect imminent.", error.Message);
|
||||||
Disconnect();
|
|
||||||
}
|
}
|
||||||
catch (Exception error)
|
catch (Exception error)
|
||||||
{
|
{
|
||||||
_log.ErrorFormat("Loop error in RPC read: {0}", error.ToString());
|
_log.ErrorFormat("Loop error in RPC read: {0}", error.ToString());
|
||||||
Disconnect();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_log.Debug("Now not receiving RPC messages anymore");
|
_log.Debug("Now not receiving RPC messages anymore");
|
||||||
|
Disconnect();
|
||||||
}, _cancellationToken);
|
}, _cancellationToken);
|
||||||
|
|
||||||
_log.Debug("Connect() done");
|
_log.Debug("Connect() done");
|
||||||
|
|
Loading…
Reference in New Issue