The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
March 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

JNDI and service port lookup by name

Posted by John Lonergan on March 01, 2001 at 7:05 AM

In the C world the call getservbyname() converts
a service name into it's port number.

I'm guessing that the way to achieve the same in Java is to use
JNDI with the NIS and FS adapters
(for NIS and filesystem /etc/services lookups respectively).

Does anyone have a code snippet that does this ?

The documentation and example code for JNDI is pretty impenetrable.

Please note I'm not talking about IP addresses here so don't
bother looking at java.net.InetAddress.





Replies:
  • Re Garima March 26, 2001 at 6:40 AM (2)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us