[Libwebsockets] Connection Error Code

Andy Green andy at warmcat.com
Tue Dec 16 01:59:03 CET 2014



On 15 December 2014 20:54:26 GMT+08:00, sonal gupta <sonal6226 at gmail.com> wrote:
>Hi Andy,
>
>How do extract various error condition codes which may occur in case of
>connection faliure ?
>
>As per standrad, follwoing error code occurs in Libwebsockets. But
>which
>api or callback is used to handle them on upper layer.

Right now there is no way.  You closed and that's it.

In many cases there's no information anyway, eg, it was not or did not make it to an established websocket connection, or he closed in an uncontrolled way outside ws control.

But it's true if it was a ws connection, and it was closed inside ws control, there is more info we could provide.

Would you like to make a patch for this functionality?

-Andy

>enum lws_close_status {
>LWS_CLOSE_STATUS_NOSTATUS = 0,
>LWS_CLOSE_STATUS_NORMAL = 1000,
>LWS_CLOSE_STATUS_GOINGAWAY = 1001,
>LWS_CLOSE_STATUS_PROTOCOL_ERR = 1002,
>LWS_CLOSE_STATUS_UNACCEPTABLE_OPCODE = 1003,
>LWS_CLOSE_STATUS_RESERVED = 1004,
>LWS_CLOSE_STATUS_NO_STATUS = 1005,
>LWS_CLOSE_STATUS_ABNORMAL_CLOSE = 1006,
>LWS_CLOSE_STATUS_INVALID_PAYLOAD = 1007,
>LWS_CLOSE_STATUS_POLICY_VIOLATION = 1008,
>LWS_CLOSE_STATUS_MESSAGE_TOO_LARGE = 1009,
>LWS_CLOSE_STATUS_EXTENSION_REQUIRED = 1010,
>LWS_CLOSE_STATUS_UNEXPECTED_CONDITION = 1011,
>LWS_CLOSE_STATUS_TLS_FAILURE = 1015,
>};
>
>Please provide your valuable feedback.
>Thanks for giving helplful replies for previous query.
>
>Regards,
>Sonal




More information about the Libwebsockets mailing list