I need something like the C function getservbyname() 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 this bug 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?
I need something like the C function getservbyname() for a Java application. I’ve got
Share
In this question I found a library here which seems to do its best to provide thid functionality cross platform.