chuckremes / ffi-rzmq

FFI bindings for ZeroMQ so the library can be used under JRuby and other FFI-compliant ruby runtimes
242 stars 62 forks source link

Jruby fixes #64

Closed mostlyobvious closed 12 years ago

mostlyobvious commented 12 years ago

In my undestanding tests broke on JRuby because poller was using wrong file descriptors for sockets. I'm not a JRuby expert but as cited on http://kenai.com/projects/jruby/pages/RubySummerOfCode2010:

"Currently most file descriptors in JRuby are fake ones, but these fake file descriptors can cause conflicts when one wants to instantiate an I/O object from a native OS file descriptor, e.g. with UNIXSocket.for_fd. There should be some way to distinguish fake from real file descriptors just by looking at their values, e.g. by numbering fake file descriptors starting from the file descriptor limit."

I've seen several gems (posix-spawn, childprocess) that workaround this by getting file descriptor using JRuby/NIO internals.

This PR: