Network World
Monday, December 1, 2008
DNSstuff.com
Get information about your IP
IP Information
50+ On-demand DNS and network tools

Community

Navigation

Blocking a Java app from accessing the Internet

Average: 3 (1 vote)

I want to stop the computer to access the Internet using Java program.

How can I do that?

Blass
Answer by Steve Blass

Expert's answer

To 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.

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <i> <b> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <br /> <br> <p>
  • Lines and paragraphs break automatically.
  • You can use BBCode tags in the text.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Advertisement: