/// The WebSocket class provides methods and properties for two-way communication using the WebSocket protocol (RFC 6455).
/// The WebSocket class provides a set of methods and properties for two-way communication
/// using the WebSocket protocol (<see href="http://tools.ietf.org/html/rfc6455">RFC 6455</see>).
/// </remarks>
/// </remarks>
publicclassWebSocket:IDisposable
publicclassWebSocket:IDisposable
{
{
@ -73,6 +74,7 @@ namespace WebSocketSharp {
privateAutoResetEvent_exitReceiving;
privateAutoResetEvent_exitReceiving;
privateObject_forClose;
privateObject_forClose;
privateObject_forSend;
privateObject_forSend;
privatestring_origin;
privatestring_protocol;
privatestring_protocol;
privatestring_protocols;
privatestring_protocols;
privatevolatileWsState_readyState;
privatevolatileWsState_readyState;
@ -92,6 +94,7 @@ namespace WebSocketSharp {
_extensions=String.Empty;
_extensions=String.Empty;
_forClose=newObject();
_forClose=newObject();
_forSend=newObject();
_forSend=newObject();
_origin=String.Empty;
_protocol=String.Empty;
_protocol=String.Empty;
_readyState=WsState.CONNECTING;
_readyState=WsState.CONNECTING;
}
}
@ -123,11 +126,8 @@ namespace WebSocketSharp {
/// <summary>
/// <summary>
/// Initializes a new instance of the <see cref="WebSocket"/> class with the specified WebSocket URL and subprotocols.
/// Initializes a new instance of the <see cref="WebSocket"/> class with the specified WebSocket URL and subprotocols.
/// </summary>
/// </summary>
/// <remarks>
///
/// </remarks>
/// <param name="url">
/// <param name="url">
/// A <see cref="string"/> that contains a WebSocket URL.
/// A <see cref="string"/> that contains a WebSocket URL to connect.
/// </param>
/// </param>
/// <param name="protocols">
/// <param name="protocols">
/// An array of <see cref="string"/> that contains the WebSocket subprotocols if any.
/// An array of <see cref="string"/> that contains the WebSocket subprotocols if any.
@ -166,7 +166,7 @@ namespace WebSocketSharp {
/// establishes a WebSocket connection.
/// establishes a WebSocket connection.
/// </remarks>
/// </remarks>
/// <param name="url">
/// <param name="url">
/// A <see cref="string"/> that contains a WebSocket URL.
/// A <see cref="string"/> that contains a WebSocket URL to connect.
/// </param>
/// </param>
/// <param name="onOpen">
/// <param name="onOpen">
/// An <see cref="OnOpen"/> event handler.
/// An <see cref="OnOpen"/> event handler.
@ -241,7 +241,8 @@ namespace WebSocketSharp {
/// Gets the extensions selected by the server.
/// Gets the extensions selected by the server.
/// </summary>
/// </summary>
/// <value>
/// <value>
/// A <see cref="string"/> that contains the extensions if any. By default, <c>String.Empty</c>. (Currently this will only ever be the <c>String.Empty</c>.)
/// A <see cref="string"/> that contains the extensions if any. The default is <see cref="String.Empty"/>.
/// (Currently this will only ever be the <see cref="String.Empty"/>.)
/// </value>
/// </value>
publicstringExtensions{
publicstringExtensions{
get{
get{
@ -276,6 +277,47 @@ namespace WebSocketSharp {
}
}
}
}
/// <summary>
/// Gets or sets the value of the Origin header used in the WebSocket opening handshake.
/// </summary>
/// <remarks>
/// A <see cref="WebSocket"/> instance does not send the Origin header in the WebSocket opening handshake
/// if the value of this property is <see cref="String.Empty"/>.
/// </remarks>
/// <value>
/// <para>
/// A <see cref="string"/> that contains the value of the <see href="http://tools.ietf.org/html/rfc6454#section-7">HTTP Origin header</see> to send.
/// The default is <see cref="String.Empty"/>.
/// </para>
/// <para>
/// The value of the Origin header has the following syntax: <c><scheme>://<host>[:<port>]</c>
/// </para>
/// </value>
publicstringOrigin{
get{
return_origin;
}
set{
varorigin=value.ToUri();
varmsg=_readyState==WsState.OPEN
?"The WebSocket connection has been established already."
Initializes a new instance of the <seecref="T:WebSocketSharp.WebSocket"/> class with the specified WebSocket URL and subprotocols.
Initializes a new instance of the <seecref="T:WebSocketSharp.WebSocket"/> class with the specified WebSocket URL and subprotocols.
</summary>
</summary>
<remarks>
</remarks>
<paramname="url">
<paramname="url">
A <seecref="T:System.String"/> that contains a WebSocket URL.
A <seecref="T:System.String"/> that contains a WebSocket URL to connect.
</param>
</param>
<paramname="protocols">
<paramname="protocols">
An array of <seecref="T:System.String"/> that contains the WebSocket subprotocols if any.
An array of <seecref="T:System.String"/> that contains the WebSocket subprotocols if any.
@ -899,7 +898,7 @@
establishes a WebSocket connection.
establishes a WebSocket connection.
</remarks>
</remarks>
<paramname="url">
<paramname="url">
A <seecref="T:System.String"/> that contains a WebSocket URL.
A <seecref="T:System.String"/> that contains a WebSocket URL to connect.
</param>
</param>
<paramname="onOpen">
<paramname="onOpen">
An <seecref="E:WebSocketSharp.WebSocket.OnOpen"/> event handler.
An <seecref="E:WebSocketSharp.WebSocket.OnOpen"/> event handler.
@ -957,7 +956,8 @@
Gets the extensions selected by the server.
Gets the extensions selected by the server.
</summary>
</summary>
<value>
<value>
A <seecref="T:System.String"/> that contains the extensions if any. By default, <c>String.Empty</c>. (Currently this will only ever be the <c>String.Empty</c>.)
A <seecref="T:System.String"/> that contains the extensions if any. The default is <seecref="F:System.String.Empty"/>.
(Currently this will only ever be the <seecref="F:System.String.Empty"/>.)
</value>
</value>
</member>
</member>
<membername="P:WebSocketSharp.WebSocket.IsAlive">
<membername="P:WebSocketSharp.WebSocket.IsAlive">
@ -976,6 +976,23 @@
<c>true</c> if the connection is secure; otherwise, <c>false</c>.
<c>true</c> if the connection is secure; otherwise, <c>false</c>.
</value>
</value>
</member>
</member>
<membername="P:WebSocketSharp.WebSocket.Origin">
<summary>
Gets or sets the value of the Origin header used in the WebSocket opening handshake.
</summary>
<remarks>
A <seecref="T:WebSocketSharp.WebSocket"/> instance does not send the Origin header in the WebSocket opening handshake
if the value of this property is <seecref="F:System.String.Empty"/>.
</remarks>
<value>
<para>
A <seecref="T:System.String"/> that contains the value of the <seehref="http://tools.ietf.org/html/rfc6454#section-7">HTTP Origin header</see> to send.
The default is <seecref="F:System.String.Empty"/>.
</para>
<para>
The value of the Origin header has the following syntax: <c><scheme>://<host>[:<port>]</c></para>
A <ahref="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a> that contains the extensions if any. By default, <tt>String.Empty</tt>. (Currently this will only ever be the <tt>String.Empty</tt>.)
A <ahref="http://www.go-mono.com/docs/monodoc.ashx?link=T:System.String">string</a> that contains the extensions if any. The default is <ahref="http://www.go-mono.com/docs/monodoc.ashx?link=F:System.String.Empty">string.Empty</a>.
(Currently this will only ever be the <ahref="http://www.go-mono.com/docs/monodoc.ashx?link=F:System.String.Empty">string.Empty</a>.)
The WebSocket class provides methods and properties for two-way communication using the WebSocket protocol (RFC 6455).
The WebSocket class provides a set of methods and properties for two-way communication
using the WebSocket protocol (<seehref="http://tools.ietf.org/html/rfc6455">RFC 6455</see>).
</remarks>
</remarks>
</Docs>
</Docs>
<Members>
<Members>
@ -37,7 +38,7 @@
</Parameters>
</Parameters>
<Docs>
<Docs>
<paramname="url">
<paramname="url">
A <seecref="T:System.String"/> that contains a WebSocket URL.
A <seecref="T:System.String"/> that contains a WebSocket URL to connect.
</param>
</param>
<paramname="protocols">
<paramname="protocols">
An array of <seecref="T:System.String"/> that contains the WebSocket subprotocols if any.
An array of <seecref="T:System.String"/> that contains the WebSocket subprotocols if any.
@ -74,7 +75,7 @@
</Parameters>
</Parameters>
<Docs>
<Docs>
<paramname="url">
<paramname="url">
A <seecref="T:System.String"/> that contains a WebSocket URL.
A <seecref="T:System.String"/> that contains a WebSocket URL to connect.
</param>
</param>
<paramname="onOpen">
<paramname="onOpen">
An <seecref="E:WebSocketSharp.WebSocket.OnOpen"/> event handler.
An <seecref="E:WebSocketSharp.WebSocket.OnOpen"/> event handler.
@ -282,7 +283,8 @@
Gets the extensions selected by the server.
Gets the extensions selected by the server.
</summary>
</summary>
<value>
<value>
A <seecref="T:System.String"/> that contains the extensions if any. By default, <c>String.Empty</c>. (Currently this will only ever be the <c>String.Empty</c>.)
A <seecref="T:System.String"/> that contains the extensions if any. The default is <seecref="F:System.String.Empty"/>.
(Currently this will only ever be the <seecref="F:System.String.Empty"/>.)
Gets or sets the value of the Origin header used in the WebSocket opening handshake.
</summary>
<value>
<para>
A <seecref="T:System.String"/> that contains the value of the <seehref="http://tools.ietf.org/html/rfc6454#section-7">HTTP Origin header</see> to send.
The default is <seecref="F:System.String.Empty"/>.
</para>
<para>
The value of the Origin header has the following syntax: <c><scheme>://<host>[:<port>]</c></para>
</value>
<remarks>
A <seecref="T:WebSocketSharp.WebSocket"/> instance does not send the Origin header in the WebSocket opening handshake
if the value of this property is <seecref="F:System.String.Empty"/>.