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

Trac trac at libwebsockets.org
Fri Sep 20 14:28:54 CEST 2013


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

Comment (by agreen):

 That should be solved by this -->

 http://git.libwebsockets.org/cgi-
 bin/cgit/libwebsockets/commit/?id=5dc62ead9d858896ac5310e813873d704bb18fd8

 It add this to README.coding

 +Async nature of client connections
 +----------------------------------
 +
 +When you call libwebsocket_client_connect(..) and get a wsi back, it does
 not
 +mean your connection is active.  It just mean it started trying to
 connect.
 +
 +Your client connection is actually active only when you receive
 +LWS_CALLBACK_CLIENT_ESTABLISHED for it.
 +
 +There's a 5 second timeout for the connection, and it may give up or die
 for
 +other reasons, if any of that happens you'll get a
 +LWS_CALLBACK_CLIENT_CONNECTION_ERROR callback on protocol 0 instead for
 the
 +wsi.
 +
 +After attempting the connection and getting back a non-NULL wsi you
 should
 +loop calling libwebsocket_service() until one of the above callbacks
 occurs.
 +
 +As usual, see test-client.c for example code.

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



More information about the Libwebsockets mailing list