[Libwebsockets] return value of libwebsocket calls

Pranjali Chumbhale pranjalic at safeai.ai
Tue Mar 31 20:18:56 CEST 2020

Hello Andy,

I was just trying to understand the generic return value scheme used here.
Irrespective of the language I was using, I would need it to report it
correct in my code.

I looked through the documentation and only saw return type int. That is
why I wanted to confirm what scheme is used here. Since, you confirm that
standard linux kernel approach is used it helps.

When I have a good understanding about the API, I will contribute to
documentation if needed.
For Libwebsockets you have provided extensive and helpful resources.

I will turn to minimal examples and source in case of doubts.
Thank you again for the response.


On Mon, Mar 30, 2020 at 8:18 PM <andy at warmcat.com> wrote:

> 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.
> -Andy
> >Regards,
> >Pranjali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20200331/bff7fee0/attachment.htm>

More information about the Libwebsockets mailing list