Skip to content

Instantly share code, notes, and snippets.

@codemasta92
Created January 19, 2012 08:45
Show Gist options
  • Save codemasta92/1638824 to your computer and use it in GitHub Desktop.
Save codemasta92/1638824 to your computer and use it in GitHub Desktop.
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