[Libwebsockets] how to "close" wsi created by lws_adopt_descriptor_vhost
andy at warmcat.com
Wed Oct 11 09:58:34 CEST 2017
Basically set a timout of -1 on it using lws_set_timeout().
On master / 2.4-to-be there are constants for this, including LWS_TO_CALL_SYNC to call the close before returning from lws_set_timeout(), if you know the wsi you are closing is not the subject of the current service.
On October 11, 2017 1:41:39 PM GMT+08:00, Per Bothner <per at bothner.com> wrote:
>After creating outwsi thus:
> outwsi =lws_adopt_descriptor_vhost(vhost, 0, fd, "pty", NULL);
>how do we "close" outwsi when fd is closed?
>Specifically, after close(fd) I need for delete_from_fd(context, fd) to
>otherwise a later lws_adopt_descriptor_vhost that reuses the fd will
>when calling insert_wsi. However, delete_from_fd is private, and I
>any corresponding public API.
More information about the Libwebsockets