::Socket.getsockname returns string instead of struct sockaddr
--------------------------------------------------------------
Key: JRUBY-5232
URL: http://jira.codehaus.org/browse/JRUBY-5232
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.5.5, JRuby 1.5.3
Reporter: James Lee
Assignee: Thomas E Enebo
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
--
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