-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make poll() the default #2065
Make poll() the default #2065
Conversation
select() can still be enabled by defining CPPHTTPLIB_USE_SELECT.
@falbrechtskirchinger this suggestion sounds good to me. @alex-cornford, as far as I know, you are the only user that uses OpenVMS. So once I accept this pull request, you will have to define |
@falbrechtskirchinger I am fine to change the default behavior from My biggest concern with this pull request is that |
Agreed. I was worried that |
dcf51c4
to
cbbd5b6
Compare
@sum01 @abouvier @jimmy-park @Tachi107 I'm sure @yhirose would appreciate you looking over the CMake changes in this PR. I've added an option |
@yhirose All builds output the command line now (added |
Looks great! |
Poll is already enabled in the Debian cpp-httplib package, so it is already widely deployed :) Note to self (or to whoever wants to do so): the option should also be added to the meson build scripts |
Good to hear. Shockingly the Gentoo ebuild doesn't enable it.
I didn't care enough to add an option for the archaic |
Il 18 febbraio 2025 13:07:53 CET, Florian Albrechtskirchinger ***@***.***> ha scritto:
falbrechtskirchinger left a comment (yhirose/cpp-httplib#2065)
I didn't care enough to add an option for the archaic `select()`. Is meson even available on any OS that doesn't have `poll()`? Does meson run without `poll()`? 😆
Yeah, makes sense! Maybe it should just enable it by default, or when poll is detected on the system. Will do.
|
@yhirose OpenVMS builds and runs with and without CPPHTTPLIB_USE_SELECT defined. |
@alex-cornford Great! So, am I just misinformed then and OpenVMS does have Edit: No, it's definitely using |
The OpenVMS C++ compiler supports poll() and select(). I don't know how it works internally. |
@falbrechtskirchinger according to your list, 'NonStop OS' is the only environment and I don't think there is any user using cpp-httplib on the OS. So I am now thinking of going further, which means removing select() completely and using poll() only. It can simplify the code and reduce my maintenance cost. What do you think? |
@yhirose I have double-checked my list since I was wrong about OpenVMS.
So, it's only VxWorks, AFAICT. But, cpp-httplib doesn't build on VxWorks right now anyway: # ifdef VXWORKS
# include <sockLib.h>
# include <selectLib.h>
Removing |
Good. Could you please proceed to make the change? Thanks a lot! |
This reverts commit 6e73a63.
poll()
is available on:poll()
is not available on:select()
can still be enabled by definingCPPHTTPLIB_USE_SELECT
.Most users likely won't see any performance improvements (or the contrary), but the WebSockets code may see a minuscule improvement.