Skip to content

WebSocketClientOptions

class cAlgo.API

DesktopCLICloud

Websocket client options.

Definition

public class WebSocketClientOptions

Namespace: cAlgo.API · Group: WebSocket

Examples

var options = new WebSocketClientOptions
{
    KeepAliveInterval = TimeSpan.FromSeconds(10),
    Timeout = TimeSpan.FromSeconds(30),
    SubProtocols = new[] { "json" }
};
var client = new WebSocketClient(options);
client.Connect(new Uri("wss://stream.example.com/quotes"));
from System import Uri, TimeSpan, Array, String

options = WebSocketClientOptions()
options.KeepAliveInterval = TimeSpan.FromSeconds(10)
options.Timeout = TimeSpan.FromSeconds(30)
options.SubProtocols = Array[String](["json"])
client = WebSocketClient(options)
client.Connect(Uri("wss://stream.example.com/quotes"))

Constructors

Name Description
WebSocketClientOptionsDesktopCLICloud Creates WebSocketClientOptions with default values.

Properties

Name Description
KeepAliveIntervalDesktopCLICloudTimeSpan Gets or sets the WebSocket protocol keep-alive interval. Default value is set to 30 seconds.
SubProtocolsDesktopCLICloudIEnumerable<string> Gets or sets sub-protocols to be negotiated during the WebSocket connection handshake.
TimeoutDesktopCLICloudTimeSpan Gets or sets the operation timeout. Default value is set to 60 seconds.
UseDefaultCredentialsDesktopCLICloudbool Gets or sets a Boolean value that indicates if default credentials should be used during WebSocket handshake. Default value is false.

See also