static void DefaultInstance_ClientException(object sender, ClientExceptionEventArg e) { Console.WriteLine("ConnectionClosed"); if (sender != null) { if (sender is ReactiveTcpClient<ConnectionPair, ArraySegment<byte>>) { var cl = sender as ReactiveTcpClient<ConnectionPair, ArraySegment<byte>>; if (cl != null) { var cp = cl.ConnectionContext; if (cp != null) { try { cp.Dispose(); } catch (Exception) { } } } } } }
static void DefaultInstance_ClientException(object sender, ClientExceptionEventArg e) { Console.WriteLine("ConnectionClosed"); if (sender != null) { if (sender is ReactiveTcpClient <ConnectionPair, ArraySegment <byte> > ) { var cl = sender as ReactiveTcpClient <ConnectionPair, ArraySegment <byte> >; if (cl != null) { var cp = cl.ConnectionContext; if (cp != null) { try { cp.Dispose(); } catch (Exception) { } } } } } }
static void DefaultInstance_ClientException(object sender, ClientExceptionEventArg e) { bag.TryRemove(sender, out sender); try { Console.WriteLine(e.Exception.ToString()); ((IDisposable)sender).Dispose(); } catch (Exception) { } }
static void DefaultInstance_ClientException(object sender, ClientExceptionEventArg e) { bag.TryRemove(sender ,out sender); try { Console.WriteLine(e.Exception.ToString()); ((IDisposable)sender).Dispose(); } catch (Exception) { } }