I want to stop the computer to access the Internet using Java program.
How can I do that?
Expert's answerTo stop a particular Java application from accessing the Internet you could use a firewall like Zone Alarm installed on the computer that is capable of controlling outbound traffic to deny the application access to the network. To use a Java program to stop the computer from accessing the Internet you would essentially be implementing a firewall in Java. That will require writing platform specific Java Native Interface (JNI) code to speak to the OS level and intercept network socket traffic, which is possible, but slower and a bit more complicated than using a native compiled language like C, C++, or C# that can talk more directly to the hardware. I suppose you could write a Java program to call out to the system and disable the network interfaces but that would take the machine completely off the network. Searching the Web for "java firewall" brings back quite a few discussions on the topic, most indicating that Java is not the best choice of language for writing a firewall. |
|
Does Verizon's Voyager stack up to the iPhone? |
|
|
5 IT skills that won't boost your salary
[1,407]
Women 4 times more likely than men to cough up personal info
[589]
Japan's 10 funniest tech-related commercials [Videos]
[407]
Throwing away a promo CD is "unauthorized distribution"?
[1,265]
Adults too quick to dismiss educational video games
[682]
Attack of the iPhone clones [Slideshow]
[578]
10 things IT needs to know about AJAX
[1,258]
This Year's 25 Geekiest 25th Anniversaries [Slideshow]
[409]
|
|