Class WebSocket
Implementation of the WebSocket protocol v8.
Implements
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.ToString()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public class WebSocket : WebSocketBase, IWebSocket
Constructors
WebSocket(String)
Creates a new WebSocket.
Declaration
public WebSocket(string requestUrl)
Parameters
Type | Name | Description |
---|---|---|
System.String | requestUrl | The target URL for the WebSocket connection. |
WebSocket(String, String)
Creates a new WebSocket.
Declaration
public WebSocket(string requestUrl, string protocol)
Parameters
Type | Name | Description |
---|---|---|
System.String | requestUrl | The target URL for the WebSocket connection. |
System.String | protocol | The WebSocket protocol. |
Properties
BufferedAmount
Gets the number of bytes buffered in the send queue.
Declaration
public int BufferedAmount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Exists
Gets a value indicating whether WebSocket support exists on this platform.
Declaration
public static bool Exists { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsOpen
Gets a value indicating whether the WebSocket is connected.
Declaration
public bool IsOpen { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Protocol
Gets the WebSocket protocol.
Declaration
public string Protocol { get; }
Property Value
Type | Description |
---|---|
System.String |
Secure
Gets a value indicating whether the WebSocket is secure.
Declaration
public bool Secure { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Close()
Closes the WebSocket connection.
Declaration
public void Close()
Close(WebSocketCloseArgs)
Closes the WebSocket connection.
Declaration
public void Close(WebSocketCloseArgs closeArgs)
Parameters
Type | Name | Description |
---|---|---|
WebSocketCloseArgs | closeArgs | The close arguments |
Open(WebSocketOpenArgs)
Opens the WebSocket connection.
Declaration
public void Open(WebSocketOpenArgs openArgs)
Parameters
Type | Name | Description |
---|---|---|
WebSocketOpenArgs | openArgs | The open arguments. |
Send(WebSocketSendArgs)
Sends a message to the WebSocket server.
Declaration
public void Send(WebSocketSendArgs sendArgs)
Parameters
Type | Name | Description |
---|---|---|
WebSocketSendArgs | sendArgs | The send arguments. |