[Libwebsockets] [libwebsockets] #42: calculates number of actually sent bytes incorrectly in libwebsockets_write

Trac trac at libwebsockets.org
Thu Oct 17 15:22:13 CEST 2013


#42: calculates number of actually sent bytes incorrectly in libwebsockets_write
-------------------------------------+-----------------
  Reporter:  andreaspakulat          |      Owner:
      Type:  defect                  |     Status:  new
  Priority:  major                   |  Milestone:
 Component:  libwebsocket test apps  |    Version:
Resolution:                          |   Keywords:
-------------------------------------+-----------------

Comment (by agreen):

 Yes, if you walk up to it with megabytes to send the kernel will not send
 them in one piece.  But that's not how it's supposed to work.

 The question is about if when you do use it properly, you ever see it send
 less than the SO_SNDBUF reservation size.

 To use it properly you should set the selected protocol's rx_buffer_size
 to match the largest fragment you'll send.  Then the library will take
 care to get a reservation for the send buffer for those sockets.

 If you have a very large message, you should use the fragmentation stuff
 to send it in fragments that are below the rx_buffer_size limit.

 Then the behaviour should be reliable, and completely nonblocking allowing
 optimal service for all the sockets lws is managing.

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



More information about the Libwebsockets mailing list