permission java.net.SocketPermission "192.168.1.1:31337", "connect, accept, resolve";
What does the following permission allow? Is my Application allowed to accept connections only from 192.168.1.1:31337 (maybe an external client) or to accept connections on to 192.168.1.1:31337 (my application is running on 192.168.1.1:31337, where is the difference to ‘listen’?).
If your code is an applet or running under a java security manager you need to explicitly grant it permissions to do stuff.
By default your code has no socket permission. Your permission says that your code has the permission to accept connection on, to connect to and to resolve only the host with IP
192.168.1.1on port31337.The “accept” and “connect” actions are obvious.
The difference between listen and accept is that listening means “be prepared for connection and see if there is a connection waiting” and accepting means “ok, accept it”.
See the docs for permissions in java 7. and java.net.SocketPermission java docs