private void NetworkClosed(IOEventResult result)
{
lock (_listTCS)
{
foreach (TCSData data in _listTCS)
data.tcs.SetCanceled();
_listTCS.Clear();
}
if (_tcsConnect != null)
{
_tcsConnect.SetException(new AegisException("Connection closed when trying ConnectAndWait()"));
_tcsConnect = null;
}
}