[Libwebsockets] return value of libwebsocket calls

andy at warmcat.com andy at warmcat.com
Tue Mar 31 05:19:00 CEST 2020

On March 31, 2020 12:19:22 AM UTC, Pranjali Chumbhale <pranjalic at safeai.ai> wrote:
>Hello Team,
>Is there a standard return value used by the libwebsocket class that

Lws isn't a c++ class.  You may be trying to force it into those semantics but c++ goggles only affect the vision of the wearer.

>signifinies the call was executed properly and everything is ok?

Almost every api takes the linux kernel approach that for int return 0 is success, and for pointer returns, non-NULL is success.  For very few apis positive nonzero return has a meaning and negative indicates error, along the style of posix read().  You can look in the headers to find doxygen comments that should note any funnies.

>Like what would the return value of lws_service() be?
>Could you point me to where I can find this information?

If you are curious about how to use an api, read the api comments from the header and follow what the minimal examples do.  If you're confused by a specific api, you have the source.  And if you think some docs should be better, contribute patches to improve them.



More information about the Libwebsockets mailing list