Closed arjantop closed 8 years ago
I tested your first example using rotor (on Windows) and I saw that the socket failed to become writable as well. However, you are registering it in level triggered mode in that example whereas the second example using mio you register it in edge triggered mode.
Using edge triggered mode in the rotor example works for me to where I saw the socket become writable.
Also, I am not sure if you are using Windows or not, but last I talked to the mio guys, level trigger support on Windows is somewhat lacking (at least for v0.5). I would use edge triggered registration when possible.
I tested with both edge and level and none of them work. I tested on OS X 10.11.5, not sure why mio works.
Oh I see. Unfortunately I don't have a copy of OS X to test on.
What you could always do is see if it is a problem with rotor not receiving the writable event from mio, or if it is a problem with rotor not properly percolating the writable event up the stack to the machine.
I believe a print statement before this line might provide some information.
Ok turns out I did do something wrong: by mistake I passed the ownership of the socket to the function new
and this caused the socket to be closed.
@GGist Thanks for the help anyway :)
Ah good catch.
I guess that means the writable event that I saw on my end was just another quirk with Windows.
I tried to use rotor with this minimal code (maybe I am doing something wrong). But after starting the loop the socket never becomes ready:
This example with "raw" mio works as expected: