[Libwebsockets] [libwebsockets] #107: Missing LWS_CALLBACK_CLOSED on the the server

Trac trac at libwebsockets.org
Mon Apr 20 13:04:32 CEST 2015


#107: Missing LWS_CALLBACK_CLOSED on the the server
------------------------------------+-----------------
  Reporter:  stephang               |      Owner:
      Type:  defect                 |     Status:  new
  Priority:  major                  |  Milestone:
 Component:  libwebsockets library  |    Version:
Resolution:                         |   Keywords:
------------------------------------+-----------------

Comment (by stephang):

 I have now tested with your patch.

 Additionally I have added the following code in the switches of all
 protocols in test-server.c to see which callbacks i get (because that's
 what I am missing):
 {{{
   case LWS_CALLBACK_CLOSED:
     OutputDebugStringA ("closed <protocol>\n");
     break;
 }}}

 Then I have tested with and without write calls on the server (by
 commenting out the following line as in your patch):
 {{{
 libwebsocket_callback_on_writable_all_protocol(&protocols[PROTOCOL_DUMB_INCREMENT]);
 }}}

 It turned out that the client always establishes connections to both sub-
 protocols (dumb increment, lws mirror). However, the close callback for
 the dumb increment protocol is only fired, when the server has written
 some data. (Close http is missing entirely).

 So I guess that is what I have encountered in my implementation. Since I
 use no sub-protocols (only the default protocol 0) that close callback is
 missing entirely.
 But I think it should be there, shouldn't it?

--
Ticket URL: <http://libwebsockets.org/trac/libwebsockets/ticket/107#comment:4>
libwebsockets <http://libwebsockets.org>
libwebsockets C library



More information about the Libwebsockets mailing list