{
enum OpCode
{
- OC_CONTINUE = 0x0,
- OC_TEXT = 0x1,
- OC_BINARY = 0x2,
- OC_RESERVED_3 = 0x3,
- OC_RESERVED_4 = 0x4,
- OC_RESERVED_5 = 0x5,
- OC_RESERVED_6 = 0x6,
- OC_RESERVED_7 = 0x7,
- OC_CLOSE = 0x8,
- OC_PING = 0x9,
- OC_PONG = 0xA,
- OC_RESERVED_B = 0xB,
- OC_RESERVED_C = 0xC,
- OC_RESERVED_D = 0xD,
- OC_RESERVED_E = 0xE,
- OC_RESERVED_F = 0xF
+ OpCodeContinue = 0x0,
+ OpCodeText = 0x1,
+ OpCodeBinary = 0x2,
+ OpCodeReserved3 = 0x3,
+ OpCodeReserved4 = 0x4,
+ OpCodeReserved5 = 0x5,
+ OpCodeReserved6 = 0x6,
+ OpCodeReserved7 = 0x7,
+ OpCodeClose = 0x8,
+ OpCodePing = 0x9,
+ OpCodePong = 0xA,
+ OpCodeReservedB = 0xB,
+ OpCodeReservedC = 0xC,
+ OpCodeReservedD = 0xD,
+ OpCodeReservedE = 0xE,
+ OpCodeReservedF = 0xF
};
inline bool isOpCodeReserved(OpCode code)
{
- return ((code > OC_BINARY) && (code < OC_CLOSE)) || (code > OC_PONG);
+ return ((code > OpCodeBinary) && (code < OpCodeClose)) || (code > OpCodePong);
}
inline bool isCloseCodeValid(int closeCode)
{
return (closeCode > 999) && (closeCode < 5000) &&
- (closeCode != CC_RESERVED_1004) && //see RFC6455 7.4.1
- (closeCode != CC_MISSING_STATUS_CODE) &&
- (closeCode != CC_ABNORMAL_DISCONNECTION) &&
+ (closeCode != CloseCodeReserved1004) && //see RFC6455 7.4.1
+ (closeCode != CloseCodeMissingStatusCode) &&
+ (closeCode != CloseCodeAbnormalDisconnection) &&
((closeCode >= 3000) || (closeCode < 1012));
}