I need to create a socket connection to a site.
String name = "elektra.usm.com"
socket sock = new socket( name, port );
This wont work because the name isn't an ip address. I need to create
an InetAddress from it. How do I do that?
Jerry
> I need to create a socket connection to a site.
>
> String name = "elektra.usm.com"
> socket sock = new socket( name, port );
>
> This wont work because the name isn't an ip address.
Yes it will, because the Socket constructor will gladly accept either
a hostname or an InetAddress.
> I need to create an InetAddress from it. How do I do that?
You don't need to.
However InetAddress has a factory method that takes a hostname and
returns an InetAddress instance.
/gordon

Signature
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e