Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

InetAddress

0 views
Skip to first unread message

Dr Slushi

unread,
Dec 30, 2000, 8:34:53 PM12/30/00
to
Hey sup. I'm relatively new to Java, and i have a quick question... I wrote
a prog that can connects to another program through tcp ip. The only problem
is that since the socket is initialized with an InetAddress (or whatever its
called) anyway, I want to be able to connect to an explicit (implicit?
whatever) IP address. All I need to know is if it is possible to assign an
IP address to an InetAddress object. If not, how would i do this.

Dont bother with a detailed explanation. If it cant be done this way, just
point me to the class (or classes) i should be using.


Charles Kilbride

unread,
Dec 30, 2000, 9:59:57 PM12/30/00
to
It is possible. Simply initialize the InetAddress object with a string
containing the IP address. Example:

InetAddress ia = InetAddress.getByName("206.26.48.100") ;


Charles

-----

In article <13w36.3822$_u2.6...@nnrp1.ptd.net>,


Sent via Deja.com
http://www.deja.com/

Roedy Green

unread,
Dec 30, 2000, 11:29:05 PM12/30/00
to
On Sun, 31 Dec 2000 01:34:53 GMT, "Dr Slushi" <jag...@micx-ray.com>
wrote or quoted :

> All I need to know is if it is possible to assign an
>IP address to an InetAddress object. If not, how would i do this.

see "IP" and "DNS" in the Java glossary.

For the JAVA GLOSSARY see http://mindprod.com/jgloss.html
--
Roedy Green, Canadian Mind Products
Custom computer programming since 1963
.

0 new messages