Closed Jesus closed 5 years ago
This patch catches the error and exits early, this is safe if we assume that the IO object will be removed before waiting on select()
because it's been closed.
I've checked this with code by calling empty?
on the selector but I'd feel safer if you can confirm it will.
@headius @enebo seems my last message got eaten by some commits changing the code, but this seems a bit tricky - we need to cancel the associated selection key in this case, but can't locate it because we can't recover the original channel. Any thoughts on what to do here?
Only JRuby would throw an exception when trying to deregister a closed stream. With this patch, JRuby's implementation will behave just like the other platforms.
Closes #215.