public sealed class Sandbox.WebSocket
A WebSocket client for connecting to external services.
Note
Events handlers will be called on the synchronization context that Connect was called on.
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 1 constructors
public WebSocket(int maxMessageSize = 65536)
Initialized a new WebSocket client.
Parameters
maxMessageSize: The maximum message size to allow from the server, in bytes. Default 64 KiB. Default: 65536
No results match this filter.
Methods
Showing 8 methods
public void AddSubProtocol(string protocol)
Add a sub-protocol to be negotiated during the WebSocket connection handshake.
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.
No results match this filter.
Properties
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.
public bool Sandbox.WebSocket.IsConnected { get; set; }
Returns true as long as a WebSocket connection is established.
public string Sandbox.WebSocket.SubProtocol { get; set; }
Get the sub-protocol that was negotiated during the opening handshake.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.WebSocket |