Skip to content

WebSocketClient.State

property · WebSocketClient · cAlgo.API

DesktopCLICloud

Gets current state of WebSocketClient instance.

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 WebSocketClientState State {get;}
webSocketClient.State: WebSocketClientState

Returns WebSocketClientState

Examples

var client = new WebSocketClient();
client.Connect(new Uri("wss://stream.example.com/quotes"));
Print("WebSocket state: {0}", client.State);
from System import Uri

client = WebSocketClient()
client.Connect(Uri("wss://stream.example.com/quotes"))
api.Print(f"WebSocket state: {client.State}")