The Artima Developer Community
Sponsored Link

Java Answers Forum
net connection problems in java

1 reply on 1 page. Most recent reply: Dec 28, 2002 7:54 AM by Thomas SMETS

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
shailesh

Posts: 1
Nickname: javamughal
Registered: Dec, 2002

net connection problems in java Posted: Dec 27, 2002 2:59 AM
Reply to this message Reply
Advertisement
dear sirs,
would you please help me in following:
1. How to sense Inet connection in java?
itried this, works well for first call, but can not update itself..
///////////////
import java.net.*;
class CheckNet
{
public static void main(String args[])
{
while(true)
{
check();
try{
Thread.sleep(1000);
}catch(InterruptedException ie){System.out.println(ie);}
}
}
static void check()
{
try
{
String hostAddress ;
InetAddress localHost ;
localHost = InetAddress.getLocalHost();
hostAddress = localHost.getHostAddress();
if (hostAddress.equals( "127.0.0.1" ))
System.out.println("Not connected");
else
System.out.println("Connect to host: " + hostAddress);

}
catch(UnknownHostException ukhe){System.out.println(ukhe);}
}

}
///////////////////////////////////////////////
2. How to sense launch of an external application like IExplorer
3.How to block data exchange from local machine ie block internet connection so that browser can not fetch data from sites?
shailesh
bilalashailesh@yahoo.com
theshailesh@hotmail.com


Thomas SMETS

Posts: 307
Nickname: tsmets
Registered: Apr, 2002

Re: net connection problems in java Posted: Dec 28, 2002 7:54 AM
Reply to this message Reply
What do you mean by 'sensing' the InetAddress ?

It also make little sense to me the meaning of :
>
> 'sensing the launch of an Application'
>
?

To the last question :
The answer is a proxy or a firewall

Thomas SMETS
SCJP2 - Brussels

Flat View: This topic has 1 reply on 1 page
Topic: Applet problem Previous Topic   Next Topic Topic: RGB  - Color Question: Please Help

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use