public void ProcessMessage(MessageType type, IMessage message) { lock (_lockObject) { var state = _currentState.ProcessMessage(type, message); TryUpdateState(state); } }
public IStateManager ProcessMessage(MessageType type, IMessage message) { if (type == MessageType.Start) { _actions.AnswerCall(message); return new ConnectedStateManager(_actions); } return this; }
public IStateManager ProcessMessage(MessageType type, IMessage message) { if (type == MessageType.Ok && ByteTools.Compare(_transactionId, message.TransactionId)) { return new ConnectedStateManager(_actions); } if (type == MessageType.End) { return new DisconnectedStateManager(_actions); } return this; }
public IStateManager ProcessMessage(MessageType type, IMessage message) { if (type == MessageType.Data) { _pingTryCount = 0; _actions.OnData(new FieldData(message.Data)); return this; } if (type == MessageType.End) { return new DisconnectedStateManager(_actions); } if (type == MessageType.Ping) { _pingTryCount = 0; _actions.SendOk(message.TransactionId); } if (_pingTryCount > 0 && type == MessageType.Ok && ByteTools.Compare(_pingTransactionId, message.TransactionId)) { _pingTryCount = 0; } return this; }
public void HandleMessage(MessageType messageType, IMessage message) { _stateManager.ProcessMessage(messageType, message); }