WebSocketClientCloseStatus
enum cAlgo.API
DesktopCLICloud
An enumeration of different Web socket client close states / reasons.
Definition
public enum WebSocketClientCloseStatus
Namespace: cAlgo.API · Group: WebSocket
Examples
var client = new WebSocketClient();
client.Disconnected += args => Print("Closed with status {0}: {1}", args.Client.CloseStatus, args.Client.CloseStatusDescription);
client.Connect(new Uri("wss://stream.example.com/quotes"));
client.Close(WebSocketClientCloseStatus.NormalClosure, "cBot finished");
from System import Uri
client = WebSocketClient()
client.Disconnected += lambda args: api.Print(f"Closed with status {args.Client.CloseStatus}: {args.Client.CloseStatusDescription}")
client.Connect(Uri("wss://stream.example.com/quotes"))
client.Close(WebSocketClientCloseStatus.NormalClosure, "cBot finished")
Values
| Name | Value | Description |
|---|---|---|
Empty | 1005 | No error specified. |
EndpointUnavailable | 1001 | (1001) Indicates an endpoint is being removed. Either the server or client will become unavailable. |
InternalServerError | 1011 | (1011) The connection will be closed by the server because of an error on the server. |
InvalidMessageType | 1003 | (1003) The client or server is terminating the connection because it cannot accept the data type it received. |
InvalidPayloadData | 1007 | (1007) The client or server is terminating the connection because it has received data inconsistent with the message type. |
MandatoryExtension | 1010 | (1010) The client is terminating the connection because it expected the server to negotiate an extension. |
MessageTooBig | 1009 | (1009) The client or server is terminating the connection because it has received a message that is too big for it to process. |
NormalClosure | 1000 | (1000) The connection has closed after the request was fulfilled. |
PolicyViolation | 1008 | (1008) The connection will be closed because an endpoint has received a message that violates its policy. |
ProtocolError | 1002 | (1008) The client or server is terminating the connection because of a protocol error. |