Otp.AbstractConnection.close C# (CSharp) Method

close() public method

public close ( ) : void
return void
        public virtual void  close()
        {
            done = true;
            connected = false;
            lock(this)
            {
                try
                {
                    if (socket != null)
                    {
                        if (traceLevel >= OtpTrace.Type.ctrlThreshold)
                        {
                            OtpTrace.TraceEvent("-> CLOSE");
                        }
                        socket.Close();
                        //thread.Interrupt();
                    }
                }
                catch (System.Net.Sockets.SocketException)
                {
                    /*ignore socket close errors */
                }
                finally
                {
                    socket = null;
                }
            }
        }