-
-
Notifications
You must be signed in to change notification settings - Fork 91
Open
Description
Problem
select and poll backend didn't clear monitor#readiness in Selector#select, but ruby backend did, it set each monitors readiness to nil in Selector#select.
https://github.com/socketry/nio4r/blob/master/lib/nio/selector.rb#L87
Reproduce
Run this script to start a modified example/echo_server, then run telnet localhost 1234 several times.
can see different behaviour
use backend ruby
Listening on localhost:1234
server readiness is
*** ::1:52414 connected
server readiness is r
*** ::1:52414 disconnected
server readiness is use backend select
Listening on localhost:1234
server readiness is w
*** ::1:52423 connected
server readiness is r
*** ::1:52423 disconnected
server readiness is r
*** ::1:52424 connected
server readiness is r
*** ::1:52424 disconnected
server readiness is rAffect
In my case, I save each monitor objects, and use monitor#readable? to detect it status after invokeSelector#select (this method)
Maybe it's not right way to use monitor, but nio4r should maintain the right behaviour and document it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels