I want to make a firewall. Firstly, is a firewall solely for stopping people from connecting to your ports or does it do other stuff as well? Secondly, how do you close access to your ports? I tend to work in java and I have a limited experience of sockets and networking.