@@ -176,10 +176,11 @@ namespace InABox.Rpc
private void Client_Closed(object sender, EventArgs e)
{
+ var wasConnected = _connected;
+ _connected = false;
openEvent.Set();
- if (_connected)
+ if (wasConnected)
- _connected = false;
DoClose(RpcTransportCloseEventType.Closed);
}