[Libwebsockets] Integration with epoll

Eric Nelson eric at nelint.com
Tue Sep 8 16:36:14 CEST 2015


Hi Brice,

On 09/02/2015 02:18 PM, Brice Hamon wrote:
>
> I also use epoll internally and had to use the notification hooks to
> integrate the lib.
> 
> It wasn't hard but a lot of mapping for no good reason IMO. The
> notifications from the lib are working nicely.
> 
> I agreed it would very nice to have the lib using epoll instead of poll. 
>

I was also able to integrate with epoll(), and really only had two
issues.

Both involved the need for data within the protocol callback:
	- where/how to find the epoll fd
	- where/how to remember the EPOLL bits for each fd

The first can be taken care of through the use of the user
field in struct lws_context_creation_info at context creation
time, but the latter really needs per-socket data.

I was about to propose an API change when I noticed that there
was an API change a while back that covers it:

	https://github.com/warmcat/libwebsockets/commit/b309305

I'm using 1.2.2-1 from Ubuntu Trusty and it seems that I should
upgrade.

> On Wed, Sep 2, 2015 at 2:45 PM, Eric Nelson <andy.green at linaro.org
> <mailto:andy.green at linaro.org>> wrote:
> 
>     Hi all,
> 
>     Has anybody considered integrating epoll as a poll() alternative?
> 
>     If not, is there any interest?
> 
>     This seems straightforward and should allow better performance
>     and integration with apps that are already using epoll for their
>     main loop (which is my motivation).
> 
>     Please advise,
> 
> 
>     Eric Nelson
> 
>     _______________________________________________
>     Libwebsockets mailing list
>     Libwebsockets at ml.libwebsockets.org
>     <mailto:Libwebsockets at ml.libwebsockets.org>
>     http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
> 
> 
> 
> 
> _______________________________________________
> Libwebsockets mailing list
> Libwebsockets at ml.libwebsockets.org
> http://ml.libwebsockets.org/mailman/listinfo/libwebsockets
> 




More information about the Libwebsockets mailing list