[Modify] Edit it
This commit is contained in:
parent
e9e7430060
commit
cf9f3b11e5
@ -2858,29 +2858,74 @@ namespace WebSocketSharp
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Closes the WebSocket connection asynchronously with the specified
|
/// Closes the connection asynchronously with the specified
|
||||||
/// <paramref name="code"/> and <paramref name="reason"/>, and releases
|
/// <paramref name="code"/> and <paramref name="reason"/>.
|
||||||
/// all associated resources.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// <para>
|
/// <para>
|
||||||
/// This method does nothing if the current state of the connection is
|
/// This method does not wait for the close to be complete.
|
||||||
/// Closing or Closed.
|
|
||||||
/// </para>
|
/// </para>
|
||||||
/// <para>
|
/// <para>
|
||||||
/// This method does not wait for the close to be complete.
|
/// And this method does nothing if the current state of
|
||||||
|
/// the connection is Closing or Closed.
|
||||||
/// </para>
|
/// </para>
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
/// <param name="code">
|
/// <param name="code">
|
||||||
/// A <see cref="ushort"/> that represents the status code indicating
|
/// <para>
|
||||||
/// the reason for the close. The status codes are defined in
|
/// A <see cref="ushort"/> that represents the status code
|
||||||
/// <see href="http://tools.ietf.org/html/rfc6455#section-7.4">
|
/// indicating the reason for the close.
|
||||||
/// Section 7.4</see> of RFC 6455.
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// The status codes are defined in
|
||||||
|
/// <see href="http://tools.ietf.org/html/rfc6455#section-7.4">
|
||||||
|
/// Section 7.4</see> of RFC 6455.
|
||||||
|
/// </para>
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <param name="reason">
|
/// <param name="reason">
|
||||||
/// A <see cref="string"/> that represents the reason for the close.
|
/// <para>
|
||||||
/// The size must be 123 bytes or less.
|
/// A <see cref="string"/> that represents the reason for the close.
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// The size must be 123 bytes or less in UTF-8.
|
||||||
|
/// </para>
|
||||||
/// </param>
|
/// </param>
|
||||||
|
/// <exception cref="ArgumentOutOfRangeException">
|
||||||
|
/// <para>
|
||||||
|
/// <paramref name="code"/> is less than 1000 or greater than 4999.
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// -or-
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// The size of <paramref name="reason"/> is greater than 123 bytes.
|
||||||
|
/// </para>
|
||||||
|
/// </exception>
|
||||||
|
/// <exception cref="ArgumentException">
|
||||||
|
/// <para>
|
||||||
|
/// <paramref name="code"/> is 1011 (server error).
|
||||||
|
/// It cannot be used by clients.
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// -or-
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// <paramref name="code"/> is 1010 (mandatory extension).
|
||||||
|
/// It cannot be used by servers.
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// -or-
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// <paramref name="code"/> is 1005 (no status) and
|
||||||
|
/// there is <paramref name="reason"/>.
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// -or-
|
||||||
|
/// </para>
|
||||||
|
/// <para>
|
||||||
|
/// <paramref name="reason"/> could not be UTF-8-encoded.
|
||||||
|
/// </para>
|
||||||
|
/// </exception>
|
||||||
public void CloseAsync (ushort code, string reason)
|
public void CloseAsync (ushort code, string reason)
|
||||||
{
|
{
|
||||||
if (!code.IsCloseStatusCode ()) {
|
if (!code.IsCloseStatusCode ()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user