We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
headius
Learn more about funding links in repositories.
Report abuse
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JRuby raises a TypeError when the port is nil, whereas MRI treats nil the same way as zero.
> ruby-2.2.2 -rsocket -e 'p Socket.pack_sockaddr_in(nil, "127.0.0.1")' "\x10\x02\x00\x00\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00" > jruby-1.7.19 -rsocket -e 'p Socket.pack_sockaddr_in(nil, "127.0.0.1")' TypeError: no implicit conversion from nil to integer pack_sockaddr_in at org/jruby/ext/socket/RubySocket.java:272 (root) at -e:1
I'm using 1.7.19 in my example, but it seems the code in SocketUtils hasn't changed since 2012 in master, so I'm guessing it still applies to both 1.7.x and 9k. See https://github.com/jruby/jruby/blame/26d0b20ca324d082468bbcbc9d71709b142aa77b/core/src/main/java/org/jruby/ext/socket/SocketUtils.java#L131-L140
The text was updated successfully, but these errors were encountered:
treat port nil as 0 for pack_sockaddr_in
ddbb929
Ensure compatability with MRI Ruby closes jruby#3156
Successfully merging a pull request may close this issue.
JRuby raises a TypeError when the port is nil, whereas MRI treats nil the same way as zero.
I'm using 1.7.19 in my example, but it seems the code in SocketUtils hasn't changed since 2012 in master, so I'm guessing it still applies to both 1.7.x and 9k. See https://github.com/jruby/jruby/blame/26d0b20ca324d082468bbcbc9d71709b142aa77b/core/src/main/java/org/jruby/ext/socket/SocketUtils.java#L131-L140
The text was updated successfully, but these errors were encountered: