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); } }
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); } }