Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4240619

A way to refer to port number through an equivalent service name.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.1.8, 1.2.0
    • core-libs
    • generic
    • generic



      Name: vi73552 Date: 05/24/99


      It would be useful to have a way to define an internet address
      specifying the name of a service instead that the port number.
      The service name should be mapped to the port number via DNS
      services ( the same way the logical host name is translated in a phisical internet
      address ).

      For instance, there could be a ne constructor for the socket class
      with this interface :
         Socket ( String hostname, String service_name )

      I guess the problem is to find a platform-independent method
      equivalent to the C function getservbyname(), supplied by the
      Berkley socket library.
      (Review ID: 83403)
      ======================================================================

      Name: krT82822 Date: 12/03/99


      any 1.1.8 or higher JDK

      I need a way to obtain the port number to use for my application by querying
      for the service name (getservbyname() in C). The services table seems to be a
      pretty standard part of TCP/IP, so it would appear to be a reasonable request
      to include access to it from java.net. To me, it is no different than being
      able to query an IP address using the host name.

      The reason for this is that I have potentially many processes talking to each
      other on the same machine. In order to have a guaranteed single place where the
      port is configured, the services table must be used so I can rely on the IP
      stack instead of reading some configuration file that could be duplicated for
      each process.
      (Review ID: 98602)
      ======================================================================

            Unassigned Unassigned
            vasya Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: