5internal static class WebSocketValidate
9 string p =
string.Empty;
10 if (validStates !=
null && validStates.Length != 0)
14 if (currentState == webSocketState)
23 p =
string.Join(
", ", validStates);
30 if (
string.IsNullOrWhiteSpace(subProtocol))
35 for (
int i = 0; i < subProtocol.Length; i++)
37 char c = subProtocol[i];
38 if (c <
'!' || c >
'~')
43 if (!
char.IsLetterOrDigit(c) &&
"()<>@,;:\\\"/[]?={} ".IndexOf(c) >= 0)
66 if (!
string.IsNullOrEmpty(statusDescription))
78 if (arraySegment.
Array ==
null)
static void ValidateSubprotocol(string subProtocol)
static void ValidateArraySegment(ArraySegment< byte > arraySegment, string parameterName)
static void ValidateCloseStatus(WebSocketCloseStatus closeStatus, string statusDescription)
static void ThrowIfInvalidState(WebSocketState currentState, bool isDisposed, WebSocketState[] validStates)
static string net_WebSockets_InvalidCharInProtocolString
static string Format(string resourceFormat, object p1)
static string net_WebSockets_InvalidCloseStatusDescription
static string net_WebSockets_InvalidCloseStatusCode
static string net_WebSockets_ReasonNotNull
static string net_WebSockets_InvalidState
static string net_WebSockets_InvalidEmptySubProtocol