[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Using External EPOLL event loop
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] Using External EPOLL event loop |
Date: |
Sat, 24 Nov 2018 12:38:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
Hi!
Yes, you must use the "external event loop" option with the epoll
option, then use MHD_get_daemon_info to extract MHD's epoll FD, and then
add *that* epoll fd to your own event loop (and if that FD triggers for
reading, you must then call MHD_run). Basically, you'll be using
epoll()'s ability to be cascaded.
You can find an example in Taler's exchange/src/bank-lib/fakebank.c at
https://git.taler.net/). However, the Git web is currently down as we
are moving servers, so this link won't help you right now. So I'm also
attaching the fakebank.c code itself.
I hope this helps!
Christian
On 11/24/18 6:53 AM, Badari Prasad wrote:
> Hi
> My application is single threaded and using epoll for dispatching all
> events, with MHD, I noticed that it will create its own internal EPOLL
> through function setup_epoll_fd.
> Does MHD support working with external EPOLL event loop ? I couldn't
> find details in documentation.
>
> Could you kindly let me know the details ?
>
> Thank you
> Badari
fakebank.c
Description: Text Data
signature.asc
Description: OpenPGP digital signature