We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This code works on CRuby but not TruffleRuby:
$ ruby -v -rsocket -e'p Socket.sockaddr_in(0, Socket::INADDR_ANY)' ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin23] "\x10\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
$ ruby -v -rsocket -e'p Socket.sockaddr_in(0, Socket::INADDR_ANY)' truffleruby 23.1.1, like ruby 3.2.2, Oracle GraalVM Native [aarch64-darwin] /Users/aaron/.rubies/arm64/truffleruby-23.1.1/lib/truffle/socket/truffle/foreign.rb:280:in `pack_sockaddr_in': undefined method `empty?' for 0:Integer (NoMethodError) from /Users/aaron/.rubies/arm64/truffleruby-23.1.1/lib/truffle/socket/socket.rb:237:in `pack_sockaddr_in' from -e:1:in `<main>'
I haven't tried investigating the problem yet, just wanted to file the issue so it doesn't get lost. Thanks!
The text was updated successfully, but these errors were encountered:
Could probably be fixed by something like this?
diff --git a/lib/truffle/socket/truffle/foreign.rb b/lib/truffle/socket/truffle/foreign.rb index 9ea5838d68..d97b890831 100644 --- a/lib/truffle/socket/truffle/foreign.rb +++ b/lib/truffle/socket/truffle/foreign.rb @@ -277,7 +277,7 @@ module Truffle hints[:ai_socktype] = type hints[:ai_flags] = flags - if host and host.empty? + if host == Socket::INADDR_ANY || (host and host.empty?) host = '0.0.0.0' end
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
This code works on CRuby but not TruffleRuby:
I haven't tried investigating the problem yet, just wanted to file the issue so it doesn't get lost. Thanks!
The text was updated successfully, but these errors were encountered: