[Libwebsockets] [libwebsockets] #40: Blocking client connection

Trac trac at libwebsockets.org
Mon Sep 23 16:01:42 CEST 2013

#40: Blocking client connection
  Reporter:  JM                     |      Owner:
      Type:  defect                 |     Status:  new
  Priority:  major                  |  Milestone:
 Component:  libwebsockets library  |    Version:
Resolution:                         |   Keywords:

Comment (by ryanking8215):

 I understand what's you said and what is our difference in opinion.

 You said it is safe to write up "N" size of data on socket when the user
 callback get "WRITABLE" signal. But I didn't find the guarantee
 implementation in source code.

 Maybe you think setting the socket buffer size will make the fact that
 when the poll toggles the pollout event, there is "N" size can be writed.
 But it's wrong. Poll system will toggle pollout event when the buffer has
 free space even 1 byte often less then "N" size in non-block case.

 '''I believe you should use "SO_SNDLOWAT" option.''' It guarantees that
 poll/select toggles the pollout event when the send buffer's FREE size is
 bigger then the low watermark you set before.

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

More information about the Libwebsockets mailing list