[Libwebsockets] Some help wanted explaining how the dumb-increment-protocol works

Colin Adams colinpauladams at gmail.com
Sat May 14 20:20:01 CEST 2016


On Sun, 8 May 2016 at 22:06 Andy Green <andy at warmcat.com> wrote:

>
>
> >looking at test-server-dumb-increment.c as an implementation template.
> >I've got this roughly 1/4 working. Only one
> >LWS_CALLBACK_SERVER_WRITEABLE
>
> It sounds like you are not generating
> lws_callback_on_writable_all_protocol() to regulate those callbacks.
>

Got that fixed by determinedly hacking at idris to get plugins to work.


> >gets seen by my handler, and debugging shows it writes one byte (a "1")
>
> OK... if by 'write' we mean calls lws_write()
>

Yes.


>
> >successfully, But the number doesn't get displayed in the web page. The
> >request Server Close button DOES work (debugging shows my handler
> >receives
> >the message, but it never receives a reset\n message when I press the
> >reset
> >button.
>
> Sounds like your code for sending stuff has something wrong.
>

Indeed. And yet ...
 lws_write is returning the correct number of bytes written, and also
I am now receiving the reset request and close request properly, and
issuing an lws_close_reason, but that too isn't working. No doubt these two
facts are closely related.

I'm really writing this email in the hope of clarifying my thoughts on the
problem, but nothing's sparked into my brain in the act of writing it, so
I'll send it anyway. I dare say the answer will come to me soon.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20160514/f78290e6/attachment-0001.html>


More information about the Libwebsockets mailing list