示例#1
0
        public RlGlueOperand State(out RlGlueConnection.ConnectionState state)
        {
            int intState = reader.ReadInt32();

            if (!System.Enum.GetValues(typeof(RlGlueConnection.ConnectionState)).Cast <int>().Contains(intState))
            {
                throw new InvalidDataException("Invalid state received: " + intState);
            }

            state = (RlGlueConnection.ConnectionState)intState;

            return(this.operand);
        }
示例#2
0
        private void ReceiveAndVerifyState(RlGlueConnection.ConnectionState state)
        {
            RlGlueConnection.ConnectionState glueState;

            rlGlueConnection.Receive()
            .State(out glueState)
            .And()
            .DiscardInteger();

            if (glueState != state)
            {
                throw new InvalidDataException("Synchronization lost");
            }
        }
示例#3
0
 public RlGlueOperand State(RlGlueConnection.ConnectionState state)
 {
     SendInt((int)state);
     return(this.operand);
 }