libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] external event loop mode without using select?


From: Evgeny Grin
Subject: Re: [libmicrohttpd] external event loop mode without using select?
Date: Wed, 9 Feb 2022 11:34:55 +0300
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.5.1

For any kind of cross-platform API for sockets FDs suggestions and/or patches are welcome.

--
Evgney

On 09.02.2022 10:39, Christian Grothoff wrote:
If your platform supports it, you should grab the epoll FD from
libmicrohttpd and only plug that single FD into your event loop,
effectively cascading the two event loops.

See MHD_DAEMON_INFO_EPOLL_FD for how to grab that FD.

On 2/8/22 11:49 PM, Greg Stark wrote:
I have an existing event loop and other events I need to handle so I
was planning to use external select mode. However I'm surprised that
MHD_get_fdset is the only way to get the set of file descriptors.

It seems pointless to have MHD loop over its file descriptors
constructing an fdset and then I have to loop over the fdset to pick
out the file descriptors to add them to the event loop handler (which
preferentially uses epoll, kqueue, or poll).

I'm not expecting a large pool of web connections, in fact I would
rarely have more than one concurrent connection however there are a
lot of file descriptors used elsewhere in the application so the
maximum fd number might actually be large. fd_sets are a particularly
impractical api for this.


Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]