1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

export-libwebsocket_service_fd-api.patch

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2011-02-12 11:57:45 +00:00
parent 0d33833764
commit 9f99034f7e
3 changed files with 39 additions and 1 deletions

View 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)
{

View 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!
*

View 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>