{"action":"created","issue":{"url":"https://api.github.com/repos/celluloid/nio4r/issues/94","repository_url":"https://api.github.com/repos/celluloid/nio4r","labels_url":"https://api.github.com/repos/celluloid/nio4r/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/celluloid/nio4r/issues/94/comments","events_url":"https://api.github.com/repos/celluloid/nio4r/issues/94/events","html_url":"https://github.com/celluloid/nio4r/issues/94","id":156494744,"number":94,"title":"jruby: not properly registering interests for IO coming from ffi(?)","user":{"login":"TiagoCardoso1983","id":215707,"avatar_url":"https://avatars.githubusercontent.com/u/215707?v=3","gravatar_id":"","url":"https://api.github.com/users/TiagoCardoso1983","html_url":"https://github.com/TiagoCardoso1983","followers_url":"https://api.github.com/users/TiagoCardoso1983/followers","following_url":"https://api.github.com/users/TiagoCardoso1983/following{/other_user}","gists_url":"https://api.github.com/users/TiagoCardoso1983/gists{/gist_id}","starred_url":"https://api.github.com/users/TiagoCardoso1983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TiagoCardoso1983/subscriptions","organizations_url":"https://api.github.com/users/TiagoCardoso1983/orgs","repos_url":"https://api.github.com/users/TiagoCardoso1983/repos","events_url":"https://api.github.com/users/TiagoCardoso1983/events{/privacy}","received_events_url":"https://api.github.com/users/TiagoCardoso1983/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-24T12:29:44Z","updated_at":"2016-06-01T06:05:02Z","closed_at":null,"body":"I'm writing a [ruby client for net-snmp using ffi](https://travis-ci.org/swisscom/ruby-netsnmp) and making it compatible with celluloid-io. For MRI, it has been working alright. I'm having issues with jruby 9k, though.\r\n\r\nAll the examples have been done using 9.1.1.0 (latest release). The following example works:\r\n\r\n```ruby\r\n# example script of creating io object from fd and passing it to the selector\r\nio = IO.for_fd 2 # stderrr\r\nIO.select [], [io] #=> [], [io]\r\nselector = NIO::Selector.new\r\nselector.register(io, :w)\r\n```\r\n\r\nProblem is when I'm acting on a file descriptor coming from the snmp session structure. As it's all done in C, I'm \"deep-fetching\" from the structure and initializing an IO object, which would then be passed to the reactor. \r\n\r\n```ruby \r\n...\r\nrequire 'nio'\r\nio = IO.for_fd(fd_from_the_snmp_structure)\r\n# this works, btw\r\nIO.select [], [io] #=> [], [io]\r\n\r\nselector = NIO::Selector.new\r\nselector.register(io, :w) #=>\r\nArgumentError: mode not supported for this object: r\r\n  register at org/nio4r/Nio4r.java:172\r\n```\r\n\r\nas previously stated, it works under MRI. It might be a bug in jruby, it's a bit hard for me to figure out, problem seems however to be in the ```symbolToInterestOps``` in the java extension(?), possibly, maybe. Is the first such report, or do I have to dig a bit deeper?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/celluloid/nio4r/issues/comments/222901117","html_url":"https://github.com/celluloid/nio4r/issues/94#issuecomment-222901117","issue_url":"https://api.github.com/repos/celluloid/nio4r/issues/94","id":222901117,"user":{"login":"TiagoCardoso1983","id":215707,"avatar_url":"https://avatars.githubusercontent.com/u/215707?v=3","gravatar_id":"","url":"https://api.github.com/users/TiagoCardoso1983","html_url":"https://github.com/TiagoCardoso1983","followers_url":"https://api.github.com/users/TiagoCardoso1983/followers","following_url":"https://api.github.com/users/TiagoCardoso1983/following{/other_user}","gists_url":"https://api.github.com/users/TiagoCardoso1983/gists{/gist_id}","starred_url":"https://api.github.com/users/TiagoCardoso1983/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TiagoCardoso1983/subscriptions","organizations_url":"https://api.github.com/users/TiagoCardoso1983/orgs","repos_url":"https://api.github.com/users/TiagoCardoso1983/repos","events_url":"https://api.github.com/users/TiagoCardoso1983/events{/privacy}","received_events_url":"https://api.github.com/users/TiagoCardoso1983/received_events","type":"User","site_admin":false},"created_at":"2016-06-01T06:05:02Z","updated_at":"2016-06-01T06:05:02Z","body":"I had the feeling it was on jruby. Done. "}}
{"actor":{"display_login":"TiagoCardoso1983"}}