Class WebSocketContext
Exposes the properties used to access the information in a WebSocket handshake request.
Inheritance
System.Object
WebSocketContext
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Mars.Common.Socket.Server
Assembly: Mars.Common.dll
Syntax
public abstract class WebSocketContext
Remarks
This class is an abstract class.
Properties
| Improve this Doc View SourceHeaders
Gets the HTTP headers included in the request.
Declaration
public abstract NameValueCollection Headers { get; }
Property Value
Type | Description |
---|---|
System.Collections.Specialized.NameValueCollection | A System.Collections.Specialized.NameValueCollection that contains the headers. |
Remarks
This class is an abstract class.
|
Improve this Doc
View Source
Host
Gets the value of the Host header included in the request.
Declaration
public abstract string Host { get; }
Property Value
Type | Description |
---|---|
System.String | A System.String that represents the value of the Host header. |
Remarks
This class is an abstract class.
|
Improve this Doc
View Source
IsLocal
Gets a value indicating whether the client connected from the local computer.
Declaration
public abstract bool IsLocal { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
true if the client connected from the local computer; otherwise, false .
|
Remarks
This class is an abstract class.
|
Improve this Doc
View Source
IsWebSocketRequest
Gets a value indicating whether the request is a WebSocket handshake request.
Declaration
public abstract bool IsWebSocketRequest { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
true if the request is a WebSocket handshake request; otherwise, false .
|
Remarks
This class is an abstract class.
|
Improve this Doc
View Source
Origin
Gets the value of the Origin header included in the request.
Declaration
public abstract string Origin { get; }
Property Value
Type | Description |
---|---|
System.String | A System.String that represents the value of the Origin header. |
Remarks
This class is an abstract class.
|
Improve this Doc
View Source
QueryString
Gets the query string included in the request.
Declaration
public abstract NameValueCollection QueryString { get; }
Property Value
Type | Description |
---|---|
System.Collections.Specialized.NameValueCollection | A System.Collections.Specialized.NameValueCollection that contains the query string parameters. |
Remarks
This class is an abstract class.
|
Improve this Doc
View Source
RequestUri
Gets the URI requested by the client.
Declaration
public abstract Uri RequestUri { get; }
Property Value
Type | Description |
---|---|
System.Uri | A System.Uri that represents the requested URI. |
Remarks
This class is an abstract class.
|
Improve this Doc
View Source
SecWebSocketKey
Gets the value of the Sec-WebSocket-Key header included in the request.
Declaration
public abstract string SecWebSocketKey { get; }
Property Value
Type | Description |
---|---|
System.String | A System.String that represents the value of the Sec-WebSocket-Key header. |
Remarks
This property provides a part of the information used by the server to prove that
it received a valid WebSocket handshake request.
|
Improve this Doc
View Source
SecWebSocketProtocols
Gets the values of the Sec-WebSocket-Protocol header included in the request.
Declaration
public abstract IEnumerable<string> SecWebSocketProtocols { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | An System.Collections.Generic.IEnumerable{string} instance that provides an enumerator which supports the iteration over the values of the Sec-WebSocket-Protocol header. |
Remarks
This property represents the subprotocols requested by the client.
|
Improve this Doc
View Source
SecWebSocketVersion
Gets the value of the Sec-WebSocket-Version header included in the request.
Declaration
public abstract string SecWebSocketVersion { get; }
Property Value
Type | Description |
---|---|
System.String | A System.String that represents the value of the Sec-WebSocket-Version header. |
Remarks
This property represents the WebSocket protocol version.
|
Improve this Doc
View Source
ServerEndPoint
Gets the server endpoint as an IP address and a port number.
Declaration
public abstract IPEndPoint ServerEndPoint { get; }
Property Value
Type | Description |
---|---|
System.Net.IPEndPoint | A System.Net.IPEndPoint that represents the server endpoint. |
Remarks
This class is an abstract class.
|
Improve this Doc
View Source
UserEndPoint
Gets the client endpoint as an IP address and a port number.
Declaration
public abstract IPEndPoint UserEndPoint { get; }
Property Value
Type | Description |
---|---|
System.Net.IPEndPoint | A System.Net.IPEndPoint that represents the client endpoint. |
Remarks
This class is an abstract class.
|
Improve this Doc
View Source
WebSocket
Gets the WebSocket instance used for
two-way communication between client and server.
Declaration
public abstract WebSocket WebSocket { get; }
Property Value
Type | Description |
---|---|
WebSocket | A WebSocket. |
Remarks
This class is an abstract class.