Get port number for service name?
<p>I need something like the C function <a href="http://linux.about.com/library/cmd/blcmdl3_getservbyname.htm" rel="nofollow">getservbyname()</a> for a Java application. I've got to parse a configuration file that might contain either a port number or the service name, and in the latter case, I need to convert this to a port number to pass on to a library. I found <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4071389" rel="nofollow">this bug</a> and was a bit astonished that the question was asked in 1997 (!) and not even considered for implementation for 13 years. I don't really want to do the platform-specific parsing stuff for myself - is there any other way?</p>
