export-libwebsocket_service_fd-api.patch
authorAndy Green <andy.green@linaro.org>
Sat, 12 Feb 2011 11:57:45 +0000 (11:57 +0000)
committerAndy Green <andy.green@linaro.org>
Sat, 12 Feb 2011 11:57:45 +0000 (11:57 +0000)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/libwebsockets.c
lib/libwebsockets.h
libwebsockets-api-doc.html

index 586d603..83505c8 100644 (file)
@@ -133,7 +133,19 @@ libwebsocket_close_and_free_session(struct libwebsocket *wsi)
        free(wsi);
 }
 
-static int
+
+/**
+ * libwebsocket_service_fd() - Service polled socket with something waiting
+ * @this:      Websocket context
+ * @pollfd:    The pollfd entry describing the socket fd and which events
+ *             happened.
+ *
+ *     This function closes any active connections and then frees the
+ *     context.  After calling this, any further use of the context is
+ *     undefined.
+ */
+
+int
 libwebsocket_service_fd(struct libwebsocket_context *this,
                                                          struct pollfd *pollfd)
 {
index 0549a50..d15c2c7 100644 (file)
@@ -22,6 +22,8 @@
 #ifndef __LIBWEBSOCKET_H__
 #define __LIBWEBSOCKET_H__
 
+#include <poll.h>
+
 #define CONTEXT_PORT_NO_LISTEN 0
 
 
@@ -191,6 +193,10 @@ libwebsockets_fork_service_loop(struct libwebsocket_context *this);
 extern int
 libwebsocket_service(struct libwebsocket_context *this, int timeout_ms);
 
+extern int
+libwebsocket_service_fd(struct libwebsocket_context *this,
+                                                        struct pollfd *pollfd);
+
 /*
  * IMPORTANT NOTICE!
  *
index 2184f16..9e5f27e 100644 (file)
@@ -1,3 +1,23 @@
+<h2>libwebsocket_service_fd - Service polled socket with something waiting</h2>
+<i>int</i>
+<b>libwebsocket_service_fd</b>
+(<i>struct libwebsocket_context *</i> <b>this</b>,
+<i>struct pollfd *</i> <b>pollfd</b>)
+<h3>Arguments</h3>
+<dl>
+<dt><b>this</b>
+<dd>Websocket context
+<dt><b>pollfd</b>
+<dd>The pollfd entry describing the socket fd and which events
+happened.
+</dl>
+<h3>Description</h3>
+<blockquote>
+This function closes any active connections and then frees the
+context.  After calling this, any further use of the context is
+undefined.
+</blockquote>
+<hr>
 <h2>libwebsocket_context_destroy - Destroy the websocket context</h2>
 <i>void</i>
 <b>libwebsocket_context_destroy</b>