-
-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
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
Socket.new fails with IPPROTO_TCP #785
Comments
jruby 1.6.8 does not have this problem:
|
Error is platform-dependent. On Mac OS X, the unknown protocol is |
The third parameter should be looked up in |
@BanzaiMan, do you know which AddressFamily's should trigger looking up a ProtocolFamily versus a IPProto? My guess is it switches based on this if statement or this switch statement: https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/ext/socket/RubySocket.java#L359-L365 So when AddressFamily is INET, INET6, or UNSPEC then use IPProto and when AddressFamily is UNIX or LOCAL use ProtocolFamily? What about when AddressFamily is none of the above? |
@atambo It is not clear to me, to be honest. I'd consult @wmeissner first. |
A side question: why use Socket instead of TCPSocket? We are somewhat limited in what features of Socket we can provide since JDK does not provide a raw non-TCP socket for us to customize. |
@headius TCPSocket automatically connects on instantiation. If you don't want that, that's one reason to use Socket instead. I've actually been running into this issue as well. |
@jlee-r7 as far as I can tell this issue is no longer reproducible. @BanzaiMan does allude to it being platform dependent but jnr-constants and JRuby have changed quite a bit in the past few years :) I'm not able to repro this (on Linux though), so I'm going to close this. If you can still reproduce it with 9k please re-open! |
All of the constants are defined and have correct values.
Replacing
IPPROTO_TCP
with0
is a workaround.The text was updated successfully, but these errors were encountered: