Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.5.3, JRuby 1.5.5
-
Fix Version/s: JRuby 1.6RC1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
Before calling Socket#bind, it returns a packed sockaddr, but afterward it's a string.
The following IRB session illustrates the issue:
jruby-1.5.5 > server = ::Socket.new( ::Socket::AF_INET, ::Socket::SOCK_STREAM, 0 )
=> #<Socket:0x6fa8bd74>
jruby-1.5.5 > server.getsockname
=> "\002\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"
jruby-1.5.5 > server.bind( ::Socket.sockaddr_in( 0, "127.0.0.1") )
=> 0
jruby-1.5.5 > server.getsockname
=> "/127.0.0.1:44603"
jruby-1.5.5 > ::Socket.unpack_sockaddr_in( server.getsockname )
ArgumentError: can't resolve socket address of wrong type
from (irb):14
Note that the above works as expected in MRI and YARV.
Possibly related to this bug: http://jira.codehaus.org/browse/JRUBY-3563