Why applet couldn't be displayed while including below contents in init()?

Why applet couldn't be displayed while including below contents in init()?

ServerSocket ss = null;

int port = 4000;

try{

ss = new ServerSocket (port); //create a server socket at port 4000

client = ss.accept(); //waiting for a client to connect

System.out.println("Accepted connection from " +

client.getInetAddress() + " " +

client.getLocalPort() + " " +

client.getPort());

Five.ChatStart(); //execute run() method

}catch(IOException e){}

[513 byte] By [Daniel.Wooa] at [2007-10-2 1:54:41]
# 1

Under the restrictions of the Sandbox, you are not allowed to open ServerSockets from an applet. If you want to do so, you will have to sign your applet so it will ask for permission from the user.

Think about it: do you want a random HTML page containing an applet to be able to open a socket to the world without you knowing about it?

Herko_ter_Horsta at 2007-7-15 19:35:44 > top of Java-index,Other Topics,Java Game Development...