Open
Description
There's some peculiar behavior when read is called with no data available, for sure when nonblock but possibly also when blocking: it always just returns 0. I have traced it all the way to the libc call. The fix for jnr/jnr-enxio#44 does not appear to improve the behavior.
This prevents JRuby working with nonblocking UNIX sockets properly:
require 'io/nonblock'
require 'socket'
require 'tmpdir'
buffer = IO::Buffer.new(1000)
Dir.mktmpdir {|d|
f = File.join(d, "foo")
server = UNIXServer.new(f)
client = UNIXSocket.new(f)
client.nonblock {|client|
p buffer.read(client, 0, 10)
}
}
Outputs -35
on CRuby but 0
on JRuby.
Metadata
Metadata
Assignees
Labels
No labels