[Libwebsockets] how to get listen fd?

Andy Green andy at warmcat.com
Sat Jan 9 08:46:36 CET 2016



On January 9, 2016 3:37:18 PM GMT+08:00, Ash 20001 <ash20001 at hotmail.com> wrote:
>I have looked at the source code in server.c to see when the listening
>fd is created. I would like to gain access to this fd to set a
>different sock option on it (close on exec flag) using fcntl. However I
>can't seem to get this fd from a public API. libwebsocket_get_socket_fd
>only seems to work on wsi and wsi pointer is not provided in most
>callbacks.
>Any ideas?

I'd be willing to either expose it or add a context creation flag to perform the operation, but from a quick google you can only attach that attribute to files, at open() time.

-Andy

>
>------------------------------------------------------------------------
>
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://ml.libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list