2 * libwebsockets - lib/plat/lws-plat-esp32.c
4 * Copyright (C) 2010-2017 Andy Green <andy@warmcat.com>
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation:
9 * version 2.1 of the License.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22 #include "core/private.h"
25 lws_plat_insert_socket_into_fds(struct lws_context *context, struct lws *wsi)
27 struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
29 pt->fds[pt->fds_count++].revents = 0;
33 lws_plat_delete_socket_from_fds(struct lws_context *context,
34 struct lws *wsi, int m)
36 struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
42 lws_plat_change_pollfd(struct lws_context *context,
43 struct lws *wsi, struct lws_pollfd *pfd)
49 insert_wsi(const struct lws_context *context, struct lws *wsi)
51 assert(context->lws_lookup[wsi->desc.sockfd -
52 lws_plat_socket_offset()] == 0);
54 context->lws_lookup[wsi->desc.sockfd - \
55 lws_plat_socket_offset()] = wsi;