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
125
LWS_VISIBLE
LWS_EXTERN
lws_sockfd_type
126
lws_service_wake_fd
(
struct
lws_context *context,
int
tsi);
127
144
LWS_VISIBLE
LWS_EXTERN
int
145
lws_service_work_outstanding
(
struct
lws_context *context);
146
173
LWS_VISIBLE
LWS_EXTERN
int
174
lws_service_fd
(
struct
lws_context *context,
struct
lws_pollfd
*pollfd);
175
185
LWS_VISIBLE
LWS_EXTERN
int
186
lws_service_fd_tsi
(
struct
lws_context *context,
struct
lws_pollfd
*pollfd,
187
int
tsi);
188
206
LWS_VISIBLE
LWS_EXTERN
int
207
lws_service_adjust_timeout
(
struct
lws_context *context,
int
timeout_ms,
int
tsi);
208
233
LWS_VISIBLE
LWS_EXTERN
lws_usec_t
234
lws_service_set_now
(
struct
lws_context *context,
int
tsi,
lws_usec_t
now_us,
235
time_t now_wall);
236
237
/* Backwards compatibility */
238
#define lws_plat_service_tsi lws_service_tsi
239
240
LWS_VISIBLE
LWS_EXTERN
int
241
lws_handle_POLLOUT_event
(
struct
lws *wsi,
struct
lws_pollfd
*pollfd);
242
244
252
#if defined(LWS_WITH_LIBUV) && defined(UV_ERRNO_MAP)
253
254
/*
255
* Any direct libuv allocations in lws protocol handlers must participate in the
256
* lws reference counting scheme. Two apis are provided:
257
*
258
* - lws_libuv_static_refcount_add(handle, context, tsi) to mark the handle with
259
* a pointer to the context and increment the global uv object counter
260
*
261
* - lws_libuv_static_refcount_del() which should be used as the close callback
262
* for your own libuv objects declared in the protocol scope.
263
*
264
* Using the apis allows lws to detach itself from a libuv loop completely
265
* cleanly and at the moment all of its libuv objects have completed close.
266
*/
267
268
LWS_VISIBLE
LWS_EXTERN
uv_loop_t *
269
lws_uv_getloop(
struct
lws_context *context,
int
tsi);
270
271
LWS_VISIBLE
LWS_EXTERN
void
272
lws_libuv_static_refcount_add(uv_handle_t *,
struct
lws_context *context,
273
int
tsi);
274
275
LWS_VISIBLE
LWS_EXTERN
void
276
lws_libuv_static_refcount_del(uv_handle_t *);
277
278
#endif
/* LWS_WITH_LIBUV */
279
280
#if defined(LWS_PLAT_FREERTOS)
281
#define lws_libuv_static_refcount_add(_a, _b, _c)
282
#define lws_libuv_static_refcount_del NULL
283
#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_wake_fd
LWS_VISIBLE LWS_EXTERN lws_sockfd_type lws_service_wake_fd(struct lws_context *context, int tsi)
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_work_outstanding
LWS_VISIBLE LWS_EXTERN int lws_service_work_outstanding(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_set_now
LWS_VISIBLE LWS_EXTERN lws_usec_t lws_service_set_now(struct lws_context *context, int tsi, lws_usec_t now_us, time_t now_wall)
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_usec_t
int64_t lws_usec_t
Definition
libwebsockets.h:750
lws_sockfd_type
int lws_sockfd_type
Definition
libwebsockets.h:595
LWS_VISIBLE
#define LWS_VISIBLE
Definition
libwebsockets.h:322
include
libwebsockets
lws-service.h
Generated on
for libwebsockets by
1.19.0