[Libwebsockets] [libwebsockets] #106: Two callbacks for one write request

Trac trac at libwebsockets.org
Mon Mar 30 12:54:28 CEST 2015

#106: Two callbacks for one write request
  Reporter:  stephang               |      Owner:
      Type:  defect                 |     Status:  closed
  Priority:  minor                  |  Milestone:
 Component:  libwebsockets library  |    Version:
Resolution:  invalid                |   Keywords:
Changes (by agreen):

 * status:  new => closed
 * resolution:   => invalid


 There is no such guarantee about receiving one writeable indication.

 Under some circumstances, you can receive externally requested writeable
 indications at service time and it's OK to just just shrug at them (this
 is multi-threaded case).  If your last send got fragmeneted you'll end up
 with an extra final writeable indication.

 It's true every time though... the connection is writeable if the callback
 appears.  You just may not particularly care every time.

 Instead of making the assumption the callback itself means there's
 something to do, you must hold per-connection state and check what that
 connection should want to do, if anything, now it is writeable again.
 Have a look at the mirror sample in the test server.

Ticket URL: <http://libwebsockets.org/trac/libwebsockets/ticket/106#comment:1>
libwebsockets <http://libwebsockets.org>
libwebsockets C library

More information about the Libwebsockets mailing list