[3943] in java-interest

home help back first fref pref prev next nref lref last post

Re: InetAddress problem

daemon@ATHENA.MIT.EDU (Don Drake)
Tue Dec 5 01:29:56 1995

Date: Mon, 4 Dec 95 22:46 CST
To: "Ka-Fai Lau(MS)" <klau01@widelux.poly.edu>
From: Don Drake <drake@mcs.com>
Cc: java-interest@java.sun.com


This looks good to me, but you might want to wrap an exception around that
for good luck:

try {
   i=InetAddress.getLocalHost();
   }catch (UnknownHostException e) {
      System.out.println("UnknownHostException!!!!!!");
   }   

I have a very small applet on my home page which uses the above code
to display the users host name, IP address and the date/time.  It has been
tested on Windows 95, Windows NT, and Solaris using Netscape 2.0b3.  Source is
available also.  Check it out at http://www.mcs.com/~drake.

Hope this helps.

-Don Drake
drake@mcs.com

At 02:54 PM 12/4/95 -0500, you wrote:
>Hi, 
>	I am using a JDK beta runs on Sun Solaris system.  When I do a 
>instrcution like this,
>	
>	InetAddress 	Inet = null;
>			.
>			.
>		
>	Inet = InetAddress.getLocalHost();
>
>	
>	The program hang me up, that is, it halts at this line and does 
>not proceed.  
>		
>	Could anyone give me a answer about this? 
>
> 	Thanks very much!!
>
>Ka-Fai Lau
>-
>This message was sent to the java-interest mailing list
>Info: send 'help' to java-interest-request@java.sun.com
>

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post