Created
January 19, 2012 08:45
-
-
Save codemasta92/1638824 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (data.Length == 2) | |
{ | |
var closeCode = (uint)data.Take(2).ToArray().ToLittleEndianInt(); | |
switch (closeCode) | |
{ | |
case 1000: | |
// Do something | |
break; | |
case 1001: | |
// Do something | |
break; | |
case 1002: | |
// Do something | |
break; | |
case 1003: | |
// Do something | |
break; | |
default: | |
throw new WebSocketException(WebSocketStatusCodes.ProtocolError); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment