Get Errno::ENOTSOCK in UDPSocket.open
-------------------------------------
Key: JRUBY-2842
URL: http://jira.codehaus.org/browse/JRUBY-2842
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.1.3
Environment: Windows XP Pro, jdk1.6.0_02
Reporter: Richard Jensen
Assignee: Thomas E Enebo
Priority: Minor
Attachments: localip.rb
I have a program to try and determine the local IP address of a box from
http://coderrr.wordpress.com/2008/05/28/get-your-local-ip-address/
It works fine with the Windows 1-click ruby installer but not with JRuby 1.1.3:
C:\rubyplay>ruby -v
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
C:\rubyplay>ruby localip.rb
My local IP is: 10.211.55.8
C:\rubyplay>jruby -v
jruby 1.1.3 (ruby 1.8.6 patchlevel 114) (2008-07-20 rev 7243) [x86-java]
C:\rubyplay>jruby localip.rb
localip.rb:8:in `local_ip': Socket operation on non-socket - Not socket or not
connected (Errno::ENOTSOCK)
from localip.rb:8:in `open'
from localip.rb:8:in `local_ip'
from localip.rb:16
It also did not work with JRuby 1.1.2:
C:\rubyplay>jruby -v
ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]
C:\rubyplay>jruby localip.rb
Exception in thread "main" java.lang.NullPointerException
at org.jruby.ext.socket.RubyIPSocket.addrFor(RubyIPSocket.java:73)
at org.jruby.ext.socket.RubyIPSocket.addr(RubyIPSocket.java:85)
at
org.jruby.ext.socket.RubyIPSocketInvoker$addr_method_0_0.call(Unknown Source)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:123)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:298)
at ruby.C_3a_.rubyplay.localip.block_0$RUBY$__block__(localip.rb:10)
at
ruby.C_3a_.rubyplay.localipBlockCallback$block_0$RUBY$__block__xx1.call(Unknown
Source)
at
org.jruby.runtime.CompiledBlockLight.yield(CompiledBlockLight.java:107)
at
org.jruby.runtime.CompiledBlockLight.yield(CompiledBlockLight.java:88)
at org.jruby.runtime.Block.yield(Block.java:109)
at org.jruby.ext.socket.RubyUDPSocket.open(RubyUDPSocket.java:200)
at
org.jruby.ext.socket.RubyUDPSocketInvoker$open_s_method_0_0.call(Unknown Source)
at
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:74)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:139)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:312)
at ruby.C_3a_.rubyplay.localip.ensure_1$RUBY$__ensure__(localip.rb:8)
at ruby.C_3a_.rubyplay.localip.method__0$RUBY$local_ip(localip.rb)
at
ruby.C_3a_.rubyplay.localipInvokermethod__0$RUBY$local_ipFixed0.call(Unknown
Source)
at
org.jruby.internal.runtime.methods.CompiledMethod.call(CompiledMethod.java:48)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:123)
at
org.jruby.runtime.CallSite$InlineCachingCallSite.call(CallSite.java:298)
at ruby.C_3a_.rubyplay.localip.__file__(localip.rb:16)
at ruby.C_3a_.rubyplay.localip.__file__(localip.rb)
at ruby.C_3a_.rubyplay.localip.load(localip.rb)
at org.jruby.Ruby.runScript(Ruby.java:512)
at org.jruby.Ruby.runNormally(Ruby.java:432)
at org.jruby.Ruby.runFromMain(Ruby.java:312)
at org.jruby.Main.run(Main.java:144)
at org.jruby.Main.run(Main.java:89)
at org.jruby.Main.main(Main.java:80)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email