Skip to content

WebSocketClient.Connect

method · WebSocketClient · cAlgo.API

DesktopCLICloud

Connects WebSocketClient to passed URI.

Environment behaviour

Cloud — not supported. Connect, Send and Close do nothing: "WebSocket is not supported in cloud environment." is written to the log, State stays None and no events are raised.

Definition

public void Connect(Uri uri)
webSocketClient.Connect(uri: Uri) -> None

Parameters

Name C# type Python type Description
uri Uri Uri The server URI.

Examples

var client = new WebSocketClient();
client.Connected += args => Print("Connected to the quotes stream");
client.Connect(new Uri("wss://stream.example.com/quotes"));
from System import Uri

client = WebSocketClient()
client.Connected += lambda args: api.Print("Connected to the quotes stream")
client.Connect(Uri("wss://stream.example.com/quotes"))