-
-
Notifications
You must be signed in to change notification settings - Fork 130
ISSUE-189: EventBaseConfig::FEATURE_FDS not supported on Windows #192
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
Conversation
- Added exclusion for Windows platform
Before merging this, we should look into the IOCP feature of libevent. pecl-event added support for specifying flags yesterday (with release 2.5.0). Specifying the And I'd prefer to explicitely skip the ext-event loop instead of providing halfbaked support. |
I'm not sure that |
You say this is a small change, but it has a huge impact. By removing the feature we effectively remove watching FDs and sockets, which may allow Windows to be supported. But the loop has an inconsistent behaviour and feature support between OSes. Instead libuv may be a better alternative for Windows. (Still hoping PECL will build the DLLs soon.) |
Hm, there is no way right now to check if it supported, I hope that 2.5.0 have this functionality and of course, then it should be used to determine available features. But right now this workaround for Windows platforms allows using the library with Related issue https://bitbucket.org/osmanov/pecl-event/issues/53/eventbaseconfig-feature_fds-not-supported But Exception will be thrown only from version 2.4.3 and upper |
@inri13666 Thanks for looking into this and filing this PR! @CharlotteDunois You seem to have a good understanding what's going on under the OS level and I'm not sure I follow the discussion, perhaps you can help clear this up? It's my understanding that prior to applying this change, the I agree that IOCP might be the way forward for Windows here, but does this changeset really do any harm? Windows uses a concept of "handles" for most common streams instead of "file descriptors" anyway? |
@clue The problem is that libevent simply prefers I/O Completion Ports however have a much more powerful way of waiting for notifications. IOCP not only allow file descriptors, they also allow (winsock) sockets (and beyond that win32 event objects), not just either handles or sockets. The harm done by the changeset is simply portability. You can make libevent wait for activity on sockets and file descriptors on *nix, but on Windows this will fail. Simply because the event loop takes whatever it can get. Sure, if this is properly documented it's not that much of a big deal. However at the same time the event loop does not allow any customizations of libevent (there's no way to pass in a custom event base). IOCP would offer here the oppurtinity to give portability (at the cost of minimum ext-event v2.5.0, however that's a low cost to the value we would get). Well, this is all theory. I haven't had the time to look greater into libevent's IOCP. So I can't really say if it works like that and if it's that easy or simple. Honestly I'm fine with either way, since personally I'm not using libevent on Windows. However I see some certain value lost if we don't take the oppurtinity to properly check out IOCP. |
@CharlotteDunois Thanks for your in depth explanation! Just to clarify, the way I read the ext-event changelog (https://pecl.php.net/package-changelog.php?package=event), it means that:
@inri13666 Thank you for working on this. The way I understand your last post means that you've tested with this ext-event < 2.4.4 without the flag and could successfully handle thousands of connections? This is interesting because Windows seems to have a default FD_SETSIZE of 64 (https://docs.microsoft.com/en-us/windows/desktop/api/winsock2/nf-winsock2-select). |
@clue, yes, https://gist.github.com/inri13666/1e8d4e60ede974b97f86ed64a1fdb0e1
|
@inri13666 @clue Creating the
I'd like to propose to accept this change (although the |
Hi @CharlotteDunois
|
README.md
Outdated
@@ -704,6 +705,10 @@ $ php vendor/bin/phpunit | |||
|
|||
MIT, see [LICENSE file](LICENSE). | |||
|
|||
## Known Issues | |||
* _*pecl-event*_ on Windows is not capable of accepting arbitrary file descriptor types (`EventBaseConfig::FEATURE_FDS`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class is called EventConfig
, not EventBaseConfig
(that's only the alias in the event loop implementation).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix that line in .gitignore
and squash all the commits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also squash the commits together into one atomic commit?
@WyriHaximus feel free to use or use this https://patch-diff.githubusercontent.com/raw/reactphp/event-loop/pull/192.diff to push changes :) Cuz' for me matter current state more than author rights :) |
Fixes #189
Test results phpunit.txt