Пример #1
0
        public virtual void disconnect()
        {
            //Console.Error.WriteLine(this+":disconnect "+io+" "+connected);
            //Thread.dumpStack();

            lock (this)
            {
                if (!connected)
                {
                    return;
                }
                connected = false;
            }

            try
            {
                Close();

                eof_remote = eof_local = true;

                thread = null;

                try
                {
                    if (io != null)
                    {
                        io.Close();
                    }
                }
                catch //(Exception e)
                {
                    //e.printStackTrace();
                }
                // io=null;
            }
            finally
            {
                Channel.del(this);
            }
        }