unix-fds.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * libwebsockets - small server side websockets and web server implementation
  3. *
  4. * Copyright (C) 2010-2018 Andy Green <[email protected]>
  5. *
  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.
  10. *
  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.
  15. *
  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,
  19. * MA 02110-1301 USA
  20. */
  21. #define _GNU_SOURCE
  22. #include "core/private.h"
  23. void
  24. lws_plat_insert_socket_into_fds(struct lws_context *context, struct lws *wsi)
  25. {
  26. struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
  27. if (context->event_loop_ops->io)
  28. context->event_loop_ops->io(wsi, LWS_EV_START | LWS_EV_READ);
  29. pt->fds[pt->fds_count++].revents = 0;
  30. }
  31. void
  32. lws_plat_delete_socket_from_fds(struct lws_context *context,
  33. struct lws *wsi, int m)
  34. {
  35. struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
  36. if (context->event_loop_ops->io)
  37. context->event_loop_ops->io(wsi,
  38. LWS_EV_STOP | LWS_EV_READ | LWS_EV_WRITE);
  39. pt->fds_count--;
  40. }
  41. int
  42. lws_plat_change_pollfd(struct lws_context *context,
  43. struct lws *wsi, struct lws_pollfd *pfd)
  44. {
  45. return 0;
  46. }