示例#1
0
        public void Run()
        {
            var handshake = _reader.ReadInitialHandshakeMessage();

            handshake.BeProcessesBy(this);
            try
            {
                while (true)
                {
                    var command = _reader.ReadCommand();
                    command.BeProcessesBy(this);
                    _writer.Sync();
                }
            }
            catch (Exception e)
            {
                _writer.LogError(e.ToString());
                OnException(e);
            }
        }
示例#2
0
        public void Run()
        {
            var handshake = _reader.ReadInitialHandshakeMessage();

            handshake.BeProcessesBy(this);
            try
            {
                while (_keepRunning)
                {
                    var command = _reader.ReadCommand();
                    command.BeProcessesBy(this);
                }
                if (_exception != null)
                {
                    OnException(_exception);
                }
            }
            catch (Exception e)
            {
                _writer.LogError(e.ToString());
                OnException(e);
            }
        }