WebSocketclass
A WebSocket client for connecting to external services.
Note
Events handlers will be called on the synchronization context that Connect was called on.
Constructors1
Showing 1 constructors
public WebSocket(int maxMessageSize = 65536)
Initialized a new WebSocket client.
| Parameter | Type | Description |
|---|---|---|
| maxMessageSize = 65536 | int | The maximum message size to allow from the server, in bytes. Default 64 KiB. |
No results match this filter.
Methods8
Showing 8 methods
public void AddSubProtocol(string protocol)
Add a sub-protocol to be negotiated during the WebSocket connection handshake.
| Parameter | Type | Description |
|---|---|---|
| protocol | string | — |
void—public virtual sealed void Dispose()
Cleans up resources used by the WebSocket client. This will also immediately close the connection if it is currently open.
void—No results match this filter.
Properties3
Showing 3 properties
public bool Sandbox.WebSocket.EnableCompression { get; set; }
Enable or disable compression for the websocket. If the server supports it, compression will be enabled for all messages. Note: compression is disabled by default, and can be dangerous if you are sending secrets across the network.
bool—public bool Sandbox.WebSocket.IsConnected { get; set; }
Returns true as long as a WebSocket connection is established.
bool—public string Sandbox.WebSocket.SubProtocol { get; set; }
Get the sub-protocol that was negotiated during the opening handshake.
string—No results match this filter.