|
@ -2825,6 +2825,12 @@ namespace WebSocketSharp |
|
|
/// </param>
|
|
|
/// </param>
|
|
|
/// <exception cref="ArgumentException">
|
|
|
/// <exception cref="ArgumentException">
|
|
|
/// <para>
|
|
|
/// <para>
|
|
|
|
|
|
/// <paramref name="code"/> is an undefined enum value.
|
|
|
|
|
|
/// </para>
|
|
|
|
|
|
/// <para>
|
|
|
|
|
|
/// -or-
|
|
|
|
|
|
/// </para>
|
|
|
|
|
|
/// <para>
|
|
|
/// <paramref name="code"/> is <see cref="CloseStatusCode.ServerError"/>.
|
|
|
/// <paramref name="code"/> is <see cref="CloseStatusCode.ServerError"/>.
|
|
|
/// It cannot be used by a client.
|
|
|
/// It cannot be used by a client.
|
|
|
/// </para>
|
|
|
/// </para>
|
|
@ -2854,6 +2860,12 @@ namespace WebSocketSharp |
|
|
/// </exception>
|
|
|
/// </exception>
|
|
|
public void Close (CloseStatusCode code, string reason) |
|
|
public void Close (CloseStatusCode code, string reason) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (!code.IsDefined ()) { |
|
|
|
|
|
var msg = "An undefined enum value."; |
|
|
|
|
|
|
|
|
|
|
|
throw new ArgumentException (msg, "code"); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (_client && code == CloseStatusCode.ServerError) { |
|
|
if (_client && code == CloseStatusCode.ServerError) { |
|
|
var msg = "ServerError cannot be used."; |
|
|
var msg = "ServerError cannot be used."; |
|
|
|
|
|
|
|
|