|
|
|
@ -262,6 +262,15 @@ namespace WebSocketSharp
|
|
|
|
: null;
|
|
|
|
: null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
internal static string CheckIfValidCloseParameters (this CloseStatusCode code, string reason)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return code.IsNoStatusCode () && !reason.IsNullOrEmpty ()
|
|
|
|
|
|
|
|
? "NoStatusCode cannot have a reason."
|
|
|
|
|
|
|
|
: !reason.IsNullOrEmpty () && Encoding.UTF8.GetBytes (reason).Length > 123
|
|
|
|
|
|
|
|
? "A reason has greater than the allowable max size."
|
|
|
|
|
|
|
|
: null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
internal static string CheckIfValidCloseStatusCode (this ushort code)
|
|
|
|
internal static string CheckIfValidCloseStatusCode (this ushort code)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return !code.IsCloseStatusCode ()
|
|
|
|
return !code.IsCloseStatusCode ()
|
|
|
|
|