ConnectionDisconnected Event
Fired when a WebSocket connection is disconnected.
Syntax
ANSI (Cross Platform) virtual int FireConnectionDisconnected(AzureRelayReceiverConnectionDisconnectedEventParams *e);
typedef struct {
int ConnectionId;
int StatusCode;
const char *Description; int reserved; } AzureRelayReceiverConnectionDisconnectedEventParams; Unicode (Windows) virtual INT FireConnectionDisconnected(AzureRelayReceiverConnectionDisconnectedEventParams *e);
typedef struct {
INT ConnectionId;
INT StatusCode;
LPCWSTR Description; INT reserved; } AzureRelayReceiverConnectionDisconnectedEventParams;
- (void)onConnectionDisconnected:(int)connectionId :(int)statusCode :(NSString*)description;
#define EID_AZURERELAYRECEIVER_CONNECTIONDISCONNECTED 4 virtual INT IPWORKSMQ_CALL FireConnectionDisconnected(INT &iConnectionId, INT &iStatusCode, LPSTR &lpszDescription);
Remarks
When the connection is closed the StatusCode parameter may be used to determine if the disconnect occurred normally or if there was an error condition. If the connection is closed normally the StatusCode will be 1000. The Description parameter will contain a textual description returned by the server. Common StatusCode values are:
1000 (default) | Normal closure. |
1001 | The resource is going away. For instance the server is shutting down or a browser is navigating away from the page. |
1002 | A protocol error occurred. |
1003 | Unexpected data was received (e.g., an endpoint that only accepts text data could send this if binary data is received). |
1007 | Invalid payload data was received (e.g., an endpoint that receives non-UTF-8 data in a text message could send this). |
1008 | A generic code that indicates the endpoint received a message that violates its policy. |
1009 | A message that was too large was received. |
1010 | A required extension could not be negotiated. |
1011 | An unexpected error occurred. |