Modified WebSocket.cs

This commit is contained in:
sta 2013-03-21 16:55:53 +09:00
parent 85e8197697
commit a5a8901acb
29 changed files with 272 additions and 110 deletions

Binary file not shown.

View File

@ -488,6 +488,40 @@ namespace WebSocketSharp {
: null;
}
/// <summary>
/// Determines whether the specified <see cref="ushort"/> is in the allowable range of
/// the WebSocket close status code.
/// </summary>
/// <remarks>
/// Not allowable ranges are the followings.
/// <list type="bullet">
/// <item>
/// <term>
/// Numbers in the range 0-999 are not used.
/// </term>
/// </item>
/// <item>
/// <term>
/// Numbers which are greater than 4999 are out of the reserved close status code ranges.
/// </term>
/// </item>
/// </list>
/// </remarks>
/// <returns>
/// <c>true</c> if <paramref name="code"/> is in the allowable range of the WebSocket close status code; otherwise, <c>false</c>.
/// </returns>
/// <param name="code">
/// A <see cref="ushort"/> to test.
/// </param>
public static bool IsCloseStatusCode(this ushort code)
{
return code < 1000
? false
: code > 4999
? false
: true;
}
/// <summary>
/// Determines whether the specified <see cref="string"/> is a <see cref="String.Empty"/>.
/// </summary>

View File

@ -82,9 +82,30 @@ namespace WebSocketSharp {
#endregion
#region Properties
#region Internal Property
internal bool ContainsReservedCloseStatusCode {
get {
if (Length >= 2)
{
var code = ToBytes().SubArray(0, 2).To<ushort>(ByteOrder.BIG);
if (code == (ushort)CloseStatusCode.UNDEFINED ||
code == (ushort)CloseStatusCode.NO_STATUS_CODE ||
code == (ushort)CloseStatusCode.ABNORMAL ||
code == (ushort)CloseStatusCode.TLS_HANDSHAKE_FAILURE)
return true;
}
return false;
}
}
#endregion
#region Public Properties
public byte[] ExtensionData { get; private set; }
public byte[] ApplicationData { get; private set; }
public bool IsMasked { get; private set; }

View File

@ -327,38 +327,6 @@ namespace WebSocketSharp {
return true;
}
private bool canSendAsCloseFrame(PayloadData data)
{
if (data.Length >= 2)
{
var code = data.ToBytes().SubArray(0, 2).To<ushort>(ByteOrder.BIG);
if (code == (ushort)CloseStatusCode.NO_STATUS_CODE ||
code == (ushort)CloseStatusCode.ABNORMAL ||
code == (ushort)CloseStatusCode.TLS_HANDSHAKE_FAILURE)
return false;
}
return true;
}
private bool checkCloseStatusCodeIsValid(ushort code, out string message)
{
if (code < 1000)
{
message = "Close status codes in the range 0-999 are not used: " + code;
return false;
}
if (code > 4999)
{
message = "Out of reserved close status code range: " + code;
return false;
}
message = String.Empty;
return true;
}
private bool checkFrameIsValid(WsFrame frame)
{
if (frame.IsNull())
@ -428,12 +396,12 @@ namespace WebSocketSharp {
#endif
lock(_forClose)
{
// Whether the closing handshake has been started already ?
// Whether the closing handshake has been started already?
if (_readyState == WsState.CLOSING ||
_readyState == WsState.CLOSED)
return;
// Whether the closing handshake as server is started before the connection has been established ?
// Whether the closing handshake on server is started before the connection has been established?
if (_readyState == WsState.CONNECTING && !_client)
{
sendResponseHandshake(HttpStatusCode.BadRequest);
@ -445,8 +413,8 @@ namespace WebSocketSharp {
_readyState = WsState.CLOSING;
}
// Whether a close status code that must not be set for send is used ?
if (!canSendAsCloseFrame(data))
// Whether a payload data contains the close status code which must not be set for send?
if (data.ContainsReservedCloseStatusCode)
{
onClose(new CloseEventArgs(data));
return;
@ -1107,11 +1075,15 @@ namespace WebSocketSharp {
}
/// <summary>
/// Closes the WebSocket connection with the specified <paramref name="code"/>
/// and releases all associated resources.
/// Closes the WebSocket connection with the specified <paramref name="code"/> and
/// releases all associated resources.
/// </summary>
/// <remarks>
/// Emits a <see cref="OnError"/> event if <paramref name="code"/> is not in the allowable range of
/// the WebSocket close status code, and do nothing any more.
/// </remarks>
/// <param name="code">
/// A <see cref="ushort"/> that contains a status code indicating the reason for closure.
/// A <see cref="ushort"/> that indicates the status code for closure.
/// </param>
public void Close(ushort code)
{
@ -1119,12 +1091,11 @@ namespace WebSocketSharp {
}
/// <summary>
/// Closes the WebSocket connection with the specified <paramref name="code"/>
/// and releases all associated resources.
/// Closes the WebSocket connection with the specified <paramref name="code"/> and
/// releases all associated resources.
/// </summary>
/// <param name="code">
/// One of the <see cref="CloseStatusCode"/> values that contains a status code
/// indicating the reason for closure.
/// One of the <see cref="CloseStatusCode"/> values that indicates the status code for closure.
/// </param>
public void Close(CloseStatusCode code)
{
@ -1132,20 +1103,24 @@ namespace WebSocketSharp {
}
/// <summary>
/// Closes the WebSocket connection with the specified <paramref name="code"/> and <paramref name="reason"/>,
/// and releases all associated resources.
/// Closes the WebSocket connection with the specified <paramref name="code"/> and <paramref name="reason"/>, and
/// releases all associated resources.
/// </summary>
/// <remarks>
/// Emits a <see cref="OnError"/> event if <paramref name="code"/> is not in the allowable range of
/// the WebSocket close status code, and do nothing any more.
/// </remarks>
/// <param name="code">
/// A <see cref="ushort"/> that contains a status code indicating the reason for closure.
/// A <see cref="ushort"/> that indicates the status code for closure.
/// </param>
/// <param name="reason">
/// A <see cref="string"/> that contains the reason for closure.
/// </param>
public void Close(ushort code, string reason)
{
string msg;
if (!checkCloseStatusCodeIsValid(code, out msg))
if (!code.IsCloseStatusCode())
{
var msg = String.Format("Invalid close status code: {0}", code);
onError(msg);
return;
}
@ -1154,12 +1129,11 @@ namespace WebSocketSharp {
}
/// <summary>
/// Closes the WebSocket connection with the specified <paramref name="code"/> and <paramref name="reason"/>,
/// and releases all associated resources.
/// Closes the WebSocket connection with the specified <paramref name="code"/> and <paramref name="reason"/>, and
/// releases all associated resources.
/// </summary>
/// <param name="code">
/// One of the <see cref="CloseStatusCode"/> values that contains a status code
/// indicating the reason for closure.
/// One of the <see cref="CloseStatusCode"/> values that indicates the status code for closure.
/// </param>
/// <param name="reason">
/// A <see cref="string"/> that contains the reason for closure.

View File

@ -216,6 +216,25 @@
A <see cref="T:System.String" /> that contains a separator string.
</param>
</member>
<member name="M:WebSocketSharp.Ext.IsCloseStatusCode(System.UInt16)">
<summary>
Determines whether the specified <see cref="T:System.UInt16" /> is in the allowable range of
the WebSocket close status code.
</summary>
<remarks>
Not allowable ranges are the followings.
<list type="bullet"><item><term>
Numbers in the range 0-999 are not used.
</term></item><item><term>
Numbers which are greater than 4999 are out of the reserved close status code ranges.
</term></item></list></remarks>
<returns>
<c>true</c> if <paramref name="code" /> is in the allowable range of the WebSocket close status code; otherwise, <c>false</c>.
</returns>
<param name="code">
A <see cref="T:System.UInt16" /> to test.
</param>
</member>
<member name="M:WebSocketSharp.Ext.IsEmpty(System.String)">
<summary>
Determines whether the specified <see cref="T:System.String" /> is a <see cref="F:System.String.Empty" />.
@ -964,30 +983,37 @@
</member>
<member name="M:WebSocketSharp.WebSocket.Close(System.UInt16)">
<summary>
Closes the WebSocket connection with the specified <paramref name="code" />
and releases all associated resources.
Closes the WebSocket connection with the specified <paramref name="code" /> and
releases all associated resources.
</summary>
<remarks>
Emits a <see cref="E:WebSocketSharp.WebSocket.OnError" /> event if <paramref name="code" /> is not in the allowable range of
the WebSocket close status code, and do nothing any more.
</remarks>
<param name="code">
A <see cref="T:System.UInt16" /> that contains a status code indicating the reason for closure.
A <see cref="T:System.UInt16" /> that indicates the status code for closure.
</param>
</member>
<member name="M:WebSocketSharp.WebSocket.Close(WebSocketSharp.CloseStatusCode)">
<summary>
Closes the WebSocket connection with the specified <paramref name="code" />
and releases all associated resources.
Closes the WebSocket connection with the specified <paramref name="code" /> and
releases all associated resources.
</summary>
<param name="code">
One of the <see cref="T:WebSocketSharp.CloseStatusCode" /> values that contains a status code
indicating the reason for closure.
One of the <see cref="T:WebSocketSharp.CloseStatusCode" /> values that indicates the status code for closure.
</param>
</member>
<member name="M:WebSocketSharp.WebSocket.Close(System.UInt16,System.String)">
<summary>
Closes the WebSocket connection with the specified <paramref name="code" /> and <paramref name="reason" />,
and releases all associated resources.
Closes the WebSocket connection with the specified <paramref name="code" /> and <paramref name="reason" />, and
releases all associated resources.
</summary>
<remarks>
Emits a <see cref="E:WebSocketSharp.WebSocket.OnError" /> event if <paramref name="code" /> is not in the allowable range of
the WebSocket close status code, and do nothing any more.
</remarks>
<param name="code">
A <see cref="T:System.UInt16" /> that contains a status code indicating the reason for closure.
A <see cref="T:System.UInt16" /> that indicates the status code for closure.
</param>
<param name="reason">
A <see cref="T:System.String" /> that contains the reason for closure.
@ -995,12 +1021,11 @@
</member>
<member name="M:WebSocketSharp.WebSocket.Close(WebSocketSharp.CloseStatusCode,System.String)">
<summary>
Closes the WebSocket connection with the specified <paramref name="code" /> and <paramref name="reason" />,
and releases all associated resources.
Closes the WebSocket connection with the specified <paramref name="code" /> and <paramref name="reason" />, and
releases all associated resources.
</summary>
<param name="code">
One of the <see cref="T:WebSocketSharp.CloseStatusCode" /> values that contains a status code
indicating the reason for closure.
One of the <see cref="T:WebSocketSharp.CloseStatusCode" /> values that indicates the status code for closure.
</param>
<param name="reason">
A <see cref="T:System.String" /> that contains the reason for closure.

View File

@ -385,6 +385,18 @@
<a href="#M:WebSocketSharp.Ext.GetValue(System.String,System.String)">GetValue</a>
</b>(<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a>, <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a></nobr><blockquote>
Gets the value from the specified <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a> that contains a pair of name and value are separated by a separator string.
</blockquote></td>
</tr>
<tr valign="top">
<td>
<div>static </div>
</td>
<td colspan="2">
<b>
<a href="#M:WebSocketSharp.Ext.IsCloseStatusCode(System.UInt16)">IsCloseStatusCode</a>
</b>(<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a>)<nobr> : <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean">bool</a></nobr><blockquote>
Determines whether the specified <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> is in the allowable range of
the WebSocket close status code.
</blockquote></td>
</tr>
<tr valign="top">
@ -1343,6 +1355,42 @@
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
<hr size="1" />
</blockquote>
<h3 id="M:WebSocketSharp.Ext.IsCloseStatusCode(System.UInt16)">IsCloseStatusCode Method</h3>
<blockquote id="M:WebSocketSharp.Ext.IsCloseStatusCode(System.UInt16):member">
<p class="Summary">
Determines whether the specified <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> is in the allowable range of
the WebSocket close status code.
</p>
<h2>Syntax</h2>
<div class="Signature">public static <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Boolean">bool</a> <b>IsCloseStatusCode</b> (<i>this</i> <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> code)</div>
<h4 class="Subsection">Parameters</h4>
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.IsCloseStatusCode(System.UInt16):Parameters">
<dl>
<dt>
<i>code</i>
</dt>
<dd>
A <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> to test.
</dd>
</dl>
</blockquote>
<h4 class="Subsection">Returns</h4>
<blockquote class="SubsectionBox" id="M:WebSocketSharp.Ext.IsCloseStatusCode(System.UInt16):Returns">
<tt>true</tt> if <i>code</i> is in the allowable range of the WebSocket close status code; otherwise, <tt>false</tt>.
</blockquote>
<h2 class="Section">Remarks</h2>
<div class="SectionBox" id="M:WebSocketSharp.Ext.IsCloseStatusCode(System.UInt16):Remarks">
Not allowable ranges are the followings.
<ul><li>
Numbers in the range 0-999 are not used.
</li><li>
Numbers which are greater than 4999 are out of the reserved close status code ranges.
</li></ul></div>
<h2 class="Section">Requirements</h2>
<div class="SectionBox" id="M:WebSocketSharp.Ext.IsCloseStatusCode(System.UInt16):Version Information">
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
<hr size="1" />
</blockquote>
<h3 id="M:WebSocketSharp.Ext.IsEmpty(System.String)">IsEmpty Method</h3>
<blockquote id="M:WebSocketSharp.Ext.IsEmpty(System.String):member">
<p class="Summary">

View File

@ -381,8 +381,8 @@
<b>
<a href="#M:WebSocketSharp.WebSocket.Close(System.UInt16)">Close</a>
</b>(<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a>)<blockquote>
Closes the WebSocket connection with the specified <i>code</i>
and releases all associated resources.
Closes the WebSocket connection with the specified <i>code</i> and
releases all associated resources.
</blockquote></td>
</tr>
<tr valign="top">
@ -394,8 +394,8 @@
<b>
<a href="#M:WebSocketSharp.WebSocket.Close(WebSocketSharp.CloseStatusCode)">Close</a>
</b>(<a href="../WebSocketSharp/CloseStatusCode.html">CloseStatusCode</a>)<blockquote>
Closes the WebSocket connection with the specified <i>code</i>
and releases all associated resources.
Closes the WebSocket connection with the specified <i>code</i> and
releases all associated resources.
</blockquote></td>
</tr>
<tr valign="top">
@ -407,8 +407,8 @@
<b>
<a href="#M:WebSocketSharp.WebSocket.Close(System.UInt16,System.String)">Close</a>
</b>(<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a>, <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a>)<blockquote>
Closes the WebSocket connection with the specified <i>code</i> and <i>reason</i>,
and releases all associated resources.
Closes the WebSocket connection with the specified <i>code</i> and <i>reason</i>, and
releases all associated resources.
</blockquote></td>
</tr>
<tr valign="top">
@ -420,8 +420,8 @@
<b>
<a href="#M:WebSocketSharp.WebSocket.Close(WebSocketSharp.CloseStatusCode,System.String)">Close</a>
</b>(<a href="../WebSocketSharp/CloseStatusCode.html">CloseStatusCode</a>, <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a>)<blockquote>
Closes the WebSocket connection with the specified <i>code</i> and <i>reason</i>,
and releases all associated resources.
Closes the WebSocket connection with the specified <i>code</i> and <i>reason</i>, and
releases all associated resources.
</blockquote></td>
</tr>
<tr valign="top">
@ -805,8 +805,8 @@
<h3 id="M:WebSocketSharp.WebSocket.Close(System.UInt16)">Close Method</h3>
<blockquote id="M:WebSocketSharp.WebSocket.Close(System.UInt16):member">
<p class="Summary">
Closes the WebSocket connection with the specified <i>code</i>
and releases all associated resources.
Closes the WebSocket connection with the specified <i>code</i> and
releases all associated resources.
</p>
<h2>Syntax</h2>
<div class="Signature">public <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void">void</a> <b>Close</b> (<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> code)</div>
@ -817,14 +817,15 @@
<i>code</i>
</dt>
<dd>
A <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> that contains a status code indicating the reason for closure.
A <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> that indicates the status code for closure.
</dd>
</dl>
</blockquote>
<h2 class="Section">Remarks</h2>
<div class="SectionBox" id="M:WebSocketSharp.WebSocket.Close(System.UInt16):Remarks">
<span class="NotEntered">Documentation for this section has not yet been entered.</span>
</div>
Emits a <a href="../WebSocketSharp/WebSocket.html#E:WebSocketSharp.WebSocket.OnError">WebSocket.OnError</a> event if <i>code</i> is not in the allowable range of
the WebSocket close status code, and do nothing any more.
</div>
<h2 class="Section">Requirements</h2>
<div class="SectionBox" id="M:WebSocketSharp.WebSocket.Close(System.UInt16):Version Information">
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
@ -833,8 +834,8 @@
<h3 id="M:WebSocketSharp.WebSocket.Close(WebSocketSharp.CloseStatusCode)">Close Method</h3>
<blockquote id="M:WebSocketSharp.WebSocket.Close(WebSocketSharp.CloseStatusCode):member">
<p class="Summary">
Closes the WebSocket connection with the specified <i>code</i>
and releases all associated resources.
Closes the WebSocket connection with the specified <i>code</i> and
releases all associated resources.
</p>
<h2>Syntax</h2>
<div class="Signature">public <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void">void</a> <b>Close</b> (<a href="../WebSocketSharp/CloseStatusCode.html">CloseStatusCode</a> code)</div>
@ -845,8 +846,7 @@
<i>code</i>
</dt>
<dd>
One of the <a href="../WebSocketSharp/CloseStatusCode.html">WebSocketSharp.CloseStatusCode</a> values that contains a status code
indicating the reason for closure.
One of the <a href="../WebSocketSharp/CloseStatusCode.html">WebSocketSharp.CloseStatusCode</a> values that indicates the status code for closure.
</dd>
</dl>
</blockquote>
@ -862,8 +862,8 @@
<h3 id="M:WebSocketSharp.WebSocket.Close(System.UInt16,System.String)">Close Method</h3>
<blockquote id="M:WebSocketSharp.WebSocket.Close(System.UInt16,System.String):member">
<p class="Summary">
Closes the WebSocket connection with the specified <i>code</i> and <i>reason</i>,
and releases all associated resources.
Closes the WebSocket connection with the specified <i>code</i> and <i>reason</i>, and
releases all associated resources.
</p>
<h2>Syntax</h2>
<div class="Signature">public <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void">void</a> <b>Close</b> (<a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> code, <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a> reason)</div>
@ -874,7 +874,7 @@
<i>code</i>
</dt>
<dd>
A <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> that contains a status code indicating the reason for closure.
A <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.UInt16">ushort</a> that indicates the status code for closure.
</dd>
<dt>
<i>reason</i>
@ -886,8 +886,9 @@
</blockquote>
<h2 class="Section">Remarks</h2>
<div class="SectionBox" id="M:WebSocketSharp.WebSocket.Close(System.UInt16,System.String):Remarks">
<span class="NotEntered">Documentation for this section has not yet been entered.</span>
</div>
Emits a <a href="../WebSocketSharp/WebSocket.html#E:WebSocketSharp.WebSocket.OnError">WebSocket.OnError</a> event if <i>code</i> is not in the allowable range of
the WebSocket close status code, and do nothing any more.
</div>
<h2 class="Section">Requirements</h2>
<div class="SectionBox" id="M:WebSocketSharp.WebSocket.Close(System.UInt16,System.String):Version Information">
<b>Namespace: </b>WebSocketSharp<br /><b>Assembly: </b>websocket-sharp (in websocket-sharp.dll)</div>
@ -896,8 +897,8 @@
<h3 id="M:WebSocketSharp.WebSocket.Close(WebSocketSharp.CloseStatusCode,System.String)">Close Method</h3>
<blockquote id="M:WebSocketSharp.WebSocket.Close(WebSocketSharp.CloseStatusCode,System.String):member">
<p class="Summary">
Closes the WebSocket connection with the specified <i>code</i> and <i>reason</i>,
and releases all associated resources.
Closes the WebSocket connection with the specified <i>code</i> and <i>reason</i>, and
releases all associated resources.
</p>
<h2>Syntax</h2>
<div class="Signature">public <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.Void">void</a> <b>Close</b> (<a href="../WebSocketSharp/CloseStatusCode.html">CloseStatusCode</a> code, <a href="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a> reason)</div>
@ -908,8 +909,7 @@
<i>code</i>
</dt>
<dd>
One of the <a href="../WebSocketSharp/CloseStatusCode.html">WebSocketSharp.CloseStatusCode</a> values that contains a status code
indicating the reason for closure.
One of the <a href="../WebSocketSharp/CloseStatusCode.html">WebSocketSharp.CloseStatusCode</a> values that indicates the status code for closure.
</dd>
<dt>
<i>reason</i>

View File

@ -419,6 +419,36 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IsCloseStatusCode">
<MemberSignature Language="C#" Value="public static bool IsCloseStatusCode (this ushort code);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsCloseStatusCode(unsigned int16 code) cil managed" />
<MemberType>Method</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="code" Type="System.UInt16" RefType="this" />
</Parameters>
<Docs>
<param name="code">
A <see cref="T:System.UInt16" /> to test.
</param>
<summary>
Determines whether the specified <see cref="T:System.UInt16" /> is in the allowable range of
the WebSocket close status code.
</summary>
<returns>
<c>true</c> if <paramref name="code" /> is in the allowable range of the WebSocket close status code; otherwise, <c>false</c>.
</returns>
<remarks>
Not allowable ranges are the followings.
<list type="bullet"><item><term>
Numbers in the range 0-999 are not used.
</term></item><item><term>
Numbers which are greater than 4999 are out of the reserved close status code ranges.
</term></item></list></remarks>
</Docs>
</Member>
<Member MemberName="IsEmpty">
<MemberSignature Language="C#" Value="public static bool IsEmpty (this string value);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsEmpty(string value) cil managed" />

View File

@ -134,13 +134,16 @@
</Parameters>
<Docs>
<param name="code">
A <see cref="T:System.UInt16" /> that contains a status code indicating the reason for closure.
A <see cref="T:System.UInt16" /> that indicates the status code for closure.
</param>
<summary>
Closes the WebSocket connection with the specified <paramref name="code" />
and releases all associated resources.
Closes the WebSocket connection with the specified <paramref name="code" /> and
releases all associated resources.
</summary>
<remarks>To be added.</remarks>
<remarks>
Emits a <see cref="E:WebSocketSharp.WebSocket.OnError" /> event if <paramref name="code" /> is not in the allowable range of
the WebSocket close status code, and do nothing any more.
</remarks>
</Docs>
</Member>
<Member MemberName="Close">
@ -155,12 +158,11 @@
</Parameters>
<Docs>
<param name="code">
One of the <see cref="T:WebSocketSharp.CloseStatusCode" /> values that contains a status code
indicating the reason for closure.
One of the <see cref="T:WebSocketSharp.CloseStatusCode" /> values that indicates the status code for closure.
</param>
<summary>
Closes the WebSocket connection with the specified <paramref name="code" />
and releases all associated resources.
Closes the WebSocket connection with the specified <paramref name="code" /> and
releases all associated resources.
</summary>
<remarks>To be added.</remarks>
</Docs>
@ -178,16 +180,19 @@
</Parameters>
<Docs>
<param name="code">
A <see cref="T:System.UInt16" /> that contains a status code indicating the reason for closure.
A <see cref="T:System.UInt16" /> that indicates the status code for closure.
</param>
<param name="reason">
A <see cref="T:System.String" /> that contains the reason for closure.
</param>
<summary>
Closes the WebSocket connection with the specified <paramref name="code" /> and <paramref name="reason" />,
and releases all associated resources.
Closes the WebSocket connection with the specified <paramref name="code" /> and <paramref name="reason" />, and
releases all associated resources.
</summary>
<remarks>To be added.</remarks>
<remarks>
Emits a <see cref="E:WebSocketSharp.WebSocket.OnError" /> event if <paramref name="code" /> is not in the allowable range of
the WebSocket close status code, and do nothing any more.
</remarks>
</Docs>
</Member>
<Member MemberName="Close">
@ -203,15 +208,14 @@
</Parameters>
<Docs>
<param name="code">
One of the <see cref="T:WebSocketSharp.CloseStatusCode" /> values that contains a status code
indicating the reason for closure.
One of the <see cref="T:WebSocketSharp.CloseStatusCode" /> values that indicates the status code for closure.
</param>
<param name="reason">
A <see cref="T:System.String" /> that contains the reason for closure.
</param>
<summary>
Closes the WebSocket connection with the specified <paramref name="code" /> and <paramref name="reason" />,
and releases all associated resources.
Closes the WebSocket connection with the specified <paramref name="code" /> and <paramref name="reason" />, and
releases all associated resources.
</summary>
<remarks>To be added.</remarks>
</Docs>

View File

@ -1,6 +1,6 @@
<Overview>
<Assemblies>
<Assembly Name="websocket-sharp" Version="1.0.2.35266">
<Assembly Name="websocket-sharp" Version="1.0.2.30397">
<AssemblyPublicKey>[00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 11 00 00 00 29 17 fb 89 fe c3 91 f7 2b cb 8b e2 61 d2 3f 05 93 6d 65 a8 9e 63 72 a6 f5 d5 2c f2 9d 20 fa 0b c0 70 6a f6 88 7e 8b 90 3f 39 f5 76 c8 48 e0 bb 7b b2 7b ed d3 10 a7 1a 0f 70 98 0f 7f f4 4b 53 09 d2 a5 ef 36 c3 56 b4 aa f0 91 72 63 25 07 89 e0 93 3e 3f 2e f2 b9 73 0e 12 15 5d 43 56 c3 f4 70 a5 89 fe f7 f6 ac 3e 77 c2 d8 d0 84 91 f4 0c d1 f3 8e dc c3 c3 b8 38 3d 0c bf 17 de 20 78 c1 ]</AssemblyPublicKey>
<Attributes>
<Attribute>
@ -511,6 +511,32 @@
<Link Type="WebSocketSharp.Ext" Member="M:WebSocketSharp.Ext.GetValue(System.String,System.String)" />
</Member>
</ExtensionMethod>
<ExtensionMethod>
<Targets>
<Target Type="T:System.UInt16" />
</Targets>
<Member MemberName="IsCloseStatusCode">
<MemberSignature Language="C#" Value="public static bool IsCloseStatusCode (this ushort code);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool IsCloseStatusCode(unsigned int16 code) cil managed" />
<MemberType>ExtensionMethod</MemberType>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="code" Type="System.UInt16" RefType="this" />
</Parameters>
<Docs>
<param name="code">
A <see cref="T:System.UInt16" /> to test.
</param>
<summary>
Determines whether the specified <see cref="T:System.UInt16" /> is in the allowable range of
the WebSocket close status code.
</summary>
</Docs>
<Link Type="WebSocketSharp.Ext" Member="M:WebSocketSharp.Ext.IsCloseStatusCode(System.UInt16)" />
</Member>
</ExtensionMethod>
<ExtensionMethod>
<Targets>
<Target Type="T:System.String" />

Binary file not shown.