WebSocketClient.CloseStatusDescription
property · WebSocketClient · cAlgo.API
DesktopCLICloud
Gets a description of the reason why the instance was closed.
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 string CloseStatusDescription {get;}
webSocketClient.CloseStatusDescription: str
Returns string
Examples
var client = new WebSocketClient();
client.Disconnected += args => Print("Close reason: {0}", args.Client.CloseStatusDescription);
client.Connect(new Uri("wss://stream.example.com/quotes"));
from System import Uri
client = WebSocketClient()
client.Disconnected += lambda args: api.Print(f"Close reason: {args.Client.CloseStatusDescription}")
client.Connect(Uri("wss://stream.example.com/quotes"))