Socket.getservbyname fails even if the service is defined in /etc/services
--------------------------------------------------------------------------
Key: JRUBY-4672
URL: http://jira.codehaus.org/browse/JRUBY-4672
Project: JRuby
Issue Type: Bug
Components: Extensions
Affects Versions: JRuby 1.4, JRuby 1.5
Environment: github trunk, Java 6, Mac OS X 10.6.2
Reporter: Hiro Asari
Consider:
{noformat}
aotearoa:~$ ruby -rsocket -e 'p Socket.getservbyname("blp5")'
48129
aotearoa:~$ jruby -rsocket -e 'p Socket.getservbyname("blp5")'
-e:1: no such service blp5/tcp (SocketError)
aotearoa:~$ grep 48129 /etc/services
blp5 48129/tcp # Bloomberg locator
blp5 48129/udp # Bloomberg locator
{noformat}
There is no Java API that can do what getservbyname can do (see
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4071389), so we are
currently simply looking up a map in IANA.java. Obviously, this is not a very
elegant solution.
Perhaps we can use FFI here.
--
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