Discussion Locked

Firewall in java

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I want to write a firewall in java as i know the concept behind Firewall.Firewall will simply block the selected ports without opening any listeners on it.please someone explain abt how to block a port using java program? plz dont say that use Listener and open a Server socket coz opening so many sockets on a system will crash CPU.

3 replies

by jay eckles

I don't know your requirements, so take this post at face value. My suggestion would be to rethink whether Java is the best language for what you're trying to do. Firewalls are very close to the system - they are dealing with network resources andthey are dealing with sockets at the OS level. With Java, you're putting an extra layer between you and the system - the VM. I'm sure it's possible to write a Firewall application in Java, but you're starting off at a disadvantage because Java is further abstracted from the underlying system than pretty much any other language. Often that's good, but in your case it's a hinderence.

I would suggest using a language with less abstraction, like C or C++. Visual Basic wouldn't be a good ideabecause it's also not the preferred language for systems development, and it only runs on Windows. If you stick to standard C or C++ as much as possible and keep the OS- or hardware-dependent code in separate modules, then your code will be quite portable.

Good luck.

Jay
www.jayeckles.com

by javamaster

Thank Mr.Jay for throwing light on this topic.
Can u plz give me some more hints to write a firewall? i meant say that plz let me know the underlying concept behind Firewall technology.
as per my knowledge technology will block a socket from open/listen a connection/request.

by jay eckles

I don't know too much about writing a firewall, so I only have two suggestinos. First, try going to your library and see if they have books on network programming, perhaps with a section on firewalls. Second, try going to sourceforge and looking for a firewall project - all those projects are open source, so you can read the documentation and even the source code.

Good luck.

Jay

This discussion is closed to new replies.