Esempio n. 1
0
        public void Close()
        {
            if (clientSocket != null)
            {
                TryCatchHelper.Do(() => { clientSocket.Close(); });
            }

            clientSocket = null;
        }
Esempio n. 2
0
        public void Dispose()
        {
            if (this.Socket != null)
            {
                TryCatchHelper.Do(() => { this.Socket.Shutdown(SocketShutdown.Both); });

                TryCatchHelper.Do(() => { this.Socket.Close(); });

                TryCatchHelper.Do(() => { this.Socket.Dispose(); });

                this.Socket = null;
            }

            this.receiveBuffer = null;

            this.saea_receive = null;

            parser = null;

            Console.WriteLine("ConnectionWorker disposed");
        }