Results 1 to 5 of 5

Thread: Need an InetAddress using a host

Threaded View

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    Resolved Need an InetAddress using a host

    Im adding password authentication to some code but I seem to have run into a problem. All of the requestPasswordAuthentication methods within the Authenticator class take an InetAddress object as an arg. I can't figure out how to get an instance of an InetAddres object just using a host name. The only methods that return a new instance are the following. With the last not returning an InetAddress but an IP address for the given host name.
    Code:
    static InetAddress getByAddress(byte[] addr)
    static InetAddress getByAddress(String host, byte[] addr)
    static InetAddress getByName(String host)
    I could use getByName(String host) to get the ip address then parse it into a byte array to use for getByAddress(byte[] addr) but that's really a pain.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width