Exemplo n.º 1
0
        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)
                            {

                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        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)
                            {
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        static void DefaultInstance_ClientException(object sender, ClientExceptionEventArg e)
        {
            bag.TryRemove(sender, out sender);

            try
            {
                Console.WriteLine(e.Exception.ToString());
                ((IDisposable)sender).Dispose();
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 4
0
        static void DefaultInstance_ClientException(object sender, ClientExceptionEventArg e)
        {
            bag.TryRemove(sender ,out sender);

            try
            {
                Console.WriteLine(e.Exception.ToString());
                ((IDisposable)sender).Dispose();
            }
            catch (Exception)
            {

            }
        }