[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] how to make MHD use poll instead of select
From: |
Ken Zangelin |
Subject: |
[libmicrohttpd] how to make MHD use poll instead of select |
Date: |
Tue, 29 Nov 2016 11:23:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
Hi,
I am unsuccessfully trying to get MHD use poll instead of select.
According to the documentation, MHD_USE_POLL (64) should do the trick,
however, I still see only calls to select(), after calling
MHD_start_daemon like this:
int serverMode = MHD_USE_THREAD_PER_CONNECTION | MHD_USE_POLL;
mhdDaemon = MHD_start_daemon(serverMode,
htons(port),
NULL,
NULL,
connectionTreat, NULL,
MHD_OPTION_CONNECTION_MEMORY_LIMIT, memoryLimit,
MHD_OPTION_CONNECTION_LIMIT, maxConns,
MHD_OPTION_THREAD_POOL_SIZE, threadPoolSize,
MHD_OPTION_SOCK_ADDR, (struct sockaddr*) &sad,
MHD_OPTION_NOTIFY_COMPLETED, requestCompleted, NULL,
MHD_OPTION_END);
I've tried with a few more combinations (depending on the CLI args for
our server), like:
int serverMode = MHD_USE_SELECT_INTERNALLY | MHD_USE_POLL; //
MHD_USE_POLL_INTERNALLY
And also changing poll for epoll:
int serverMode = MHD_USE_SELECT_INTERNALLY | MHD_USE_EPOLL_LINUX_ONLY;
However, no calls to poll according to strace, just select ...
I'm on CentOS 6.5 and the version of MHD (not too new), according to
microhttpd.h, is:
/**
* Current version of the library.
* 0x01093001 = 1.9.30-1.
*/
#define MHD_VERSION 0x00093300
[ A bit strange btw ... MHD_VERSION says 0.9.33-0 while the comment says
1.9.30-1 ... ]
What am I doing wrong? Why isn't poll used?
Thanks,
/Ken Z
- [libmicrohttpd] how to make MHD use poll instead of select,
Ken Zangelin <=