libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] MHD_get_fdset throws "Illegal instruction" error


From: Vitaliy T
Subject: Re: [libmicrohttpd] MHD_get_fdset throws "Illegal instruction" error
Date: Tue, 14 Mar 2017 20:01:15 +0300

Hi Evgeny,

On 14 March 2017 at 17:55, Evgeny Grin <address@hidden> wrote:
> Then you could use MHD_DAEMON_INFO_EPOLL_FD with MHD_get_daemon_info()
> or MHD_get_fdset(). MHD_get_fdset() will fill fdsets with single epoll
> fd. Epoll fd itself is select()-able, poll()-able and epollable.

Currently, I am implementing a server which should work with epoll and select.
I have solved issues with select-based implementation in a way described below:

0. From DH (default handler) I call a function  to resume a
connection, it's access
the internal database to retrieve the MHD_Connection connection handler.
1. MHD_get_fdset()
2. select() with timeout is around 0-100ms (works with both 0 and 100ms)
3. MHD_run_from_select()

In this way seems to be everything is working as expected. Also, I
have set timeout
connection value >= 15 seconds and skipped calling MHD_get_timeout().
Once again,
quote from Reference Manual:

int MHD_get_timeout (...)
...
  The function must also not be called by user-code if
MHD_USE_INTERNAL_SELECT is in use.

But, microhttpd.h again is missing this important note.


For epoll I don't know which scheme I should use. I don't really want
to implement
an external epoll. I wish something like I done above for select based daemon.

Currently, for epoll instead of using MHD_get_fdset + MHD_run_from_select I call
just MHD_run(). In such way the daemon is working as expected, at least at first
glance.

Calling MHD_get_fdset() under MHD_USE_EPOLL_LINUX_ONLY returns MHD_NO,
as I noted early. I accept such a behavior.

Any advices about using MHD & epoll will be helpful. I will be much
appreciated if
somebody gets links to projects on github, bitbucket, etc.

Thanks!

-- 
With Best Regards,
Vitaliy V. Tokarev



reply via email to

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