예제 #1
0
        public ClientWrapper(Socket socket)
        {
            _socket = socket;
            _buffer = new byte[8192];

            _parser = new MessagesParser();
            _parser.MessageParsed += Parser_MessageParsed;

            Id = Interlocked.Increment(ref _counter);
        }
예제 #2
0
        public void Dispose()
        {
            Running = false;

            _socket.Dispose();
            _parser.Dispose();
            Array.Clear(_buffer, 0, _buffer.Length);

            _socket = null;
            _parser = null;
            _buffer = null;
        }