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); }
private void ReceiveAndVerifyState(RlGlueConnection.ConnectionState state) { RlGlueConnection.ConnectionState glueState; rlGlueConnection.Receive() .State(out glueState) .And() .DiscardInteger(); if (glueState != state) { throw new InvalidDataException("Synchronization lost"); } }
public RlGlueOperand State(RlGlueConnection.ConnectionState state) { SendInt((int)state); return(this.operand); }