libwebsockets
Lightweight C library for HTML5 websockets
Toggle main menu visibility
Loading...
Searching...
No Matches
lws-service.h
Go to the documentation of this file.
1
/*
2
* libwebsockets - small server side websockets and web server implementation
3
*
4
* Copyright (C) 2010 - 2019 Andy Green <andy@warmcat.com>
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to
8
* deal in the Software without restriction, including without limitation the
9
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
* sell copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in
14
* all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
* IN THE SOFTWARE.
23
*/
24
33
66
LWS_VISIBLE
LWS_EXTERN
int
67
lws_service
(
struct
lws_context *context,
int
timeout_ms);
68
79
LWS_VISIBLE
LWS_EXTERN
int
80
lws_service_tsi
(
struct
lws_context *context,
int
timeout_ms,
int
tsi);
81
90
LWS_VISIBLE
LWS_EXTERN
void
91
lws_cancel_service_pt
(
struct
lws *wsi);
92
105
LWS_VISIBLE
LWS_EXTERN
void
106
lws_cancel_service
(
struct
lws_context *context);
107
134
LWS_VISIBLE
LWS_EXTERN
int
135
lws_service_fd
(
struct
lws_context *context,
struct
lws_pollfd
*pollfd);
136
146
LWS_VISIBLE
LWS_EXTERN
int
147
lws_service_fd_tsi
(
struct
lws_context *context,
struct
lws_pollfd
*pollfd,
148
int
tsi);
149
167
LWS_VISIBLE
LWS_EXTERN
int
168
lws_service_adjust_timeout
(
struct
lws_context *context,
int
timeout_ms,
int
tsi);
169
170
/* Backwards compatibility */
171
#define lws_plat_service_tsi lws_service_tsi
172
173
LWS_VISIBLE
LWS_EXTERN
int
174
lws_handle_POLLOUT_event
(
struct
lws *wsi,
struct
lws_pollfd
*pollfd);
175
177
185
#if defined(LWS_WITH_LIBUV) && defined(UV_ERRNO_MAP)
186
187
/*
188
* Any direct libuv allocations in lws protocol handlers must participate in the
189
* lws reference counting scheme. Two apis are provided:
190
*
191
* - lws_libuv_static_refcount_add(handle, context, tsi) to mark the handle with
192
* a pointer to the context and increment the global uv object counter
193
*
194
* - lws_libuv_static_refcount_del() which should be used as the close callback
195
* for your own libuv objects declared in the protocol scope.
196
*
197
* Using the apis allows lws to detach itself from a libuv loop completely
198
* cleanly and at the moment all of its libuv objects have completed close.
199
*/
200
201
LWS_VISIBLE
LWS_EXTERN
uv_loop_t *
202
lws_uv_getloop(
struct
lws_context *context,
int
tsi);
203
204
LWS_VISIBLE
LWS_EXTERN
void
205
lws_libuv_static_refcount_add(uv_handle_t *,
struct
lws_context *context,
206
int
tsi);
207
208
LWS_VISIBLE
LWS_EXTERN
void
209
lws_libuv_static_refcount_del(uv_handle_t *);
210
211
#endif
/* LWS_WITH_LIBUV */
212
213
#if defined(LWS_PLAT_FREERTOS)
214
#define lws_libuv_static_refcount_add(_a, _b, _c)
215
#define lws_libuv_static_refcount_del NULL
216
#endif
lws_handle_POLLOUT_event
LWS_VISIBLE LWS_EXTERN int lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd)
lws_cancel_service_pt
LWS_VISIBLE LWS_EXTERN void lws_cancel_service_pt(struct lws *wsi)
lws_service_adjust_timeout
LWS_VISIBLE LWS_EXTERN int lws_service_adjust_timeout(struct lws_context *context, int timeout_ms, int tsi)
lws_cancel_service
LWS_VISIBLE LWS_EXTERN void lws_cancel_service(struct lws_context *context)
lws_service_tsi
LWS_VISIBLE LWS_EXTERN int lws_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
lws_service_fd
LWS_VISIBLE LWS_EXTERN int lws_service_fd(struct lws_context *context, struct lws_pollfd *pollfd)
lws_service_fd_tsi
LWS_VISIBLE LWS_EXTERN int lws_service_fd_tsi(struct lws_context *context, struct lws_pollfd *pollfd, int tsi)
lws_service
LWS_VISIBLE LWS_EXTERN int lws_service(struct lws_context *context, int timeout_ms)
lws_pollfd
#define lws_pollfd
Definition
libwebsockets.h:713
LWS_EXTERN
#define LWS_EXTERN
Definition
libwebsockets.h:327
LWS_VISIBLE
#define LWS_VISIBLE
Definition
libwebsockets.h:322
include
libwebsockets
lws-service.h
Generated on
for libwebsockets by
1.18.0