[Libwebsockets] Newbie: is it possible to geenrate data from server?

Silas Parker skyhisi+libwebsockets at gmail.com
Fri Sep 21 14:33:45 CEST 2018


Hi Stefano,

You need to request a writeable callback and then you can send the data
from within the callback.

See the following page, section "Only send data when socket writeable" for
details:
https://libwebsockets.org/lws-api-doc-master/html/md_READMEs_README_8coding.html

Thanks,
Silas

On Fri, 21 Sep 2018 at 13:29, Stefano Mora <stefano.mora at newdep.com> wrote:

> Hi all,
>
> I’m developing a simple websocket server based on minimal sample.
>
> No problem when I need to reply to client but I’d like to generate data
> from server and push them to client.
>
> Is it possible?
>
> Which wsi structure do I need to point ?
>
>
>
> Thanks!
>
>
>
>
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> https://libwebsockets.org/mailman/listinfo/libwebsockets
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20180921/c087131f/attachment.html>


More information about the Libwebsockets mailing list