public static void main(String[] args) {
ServerSocket listenSocket = null;
try {
- System.out.println("Demarrage du serveur sur le port " + Integer.parseInt(args[0]) + " et en attente de connexion :");
+ System.out.println("Demarrage du serveur sur le port "
+ + Integer.parseInt(args[0]) + " et en attente de connexion :");
listenSocket = new ServerSocket(Integer.parseInt(args[0])); // port
while (true) { // le dispatcher est le thread qui execute main()
Socket clientSocket = listenSocket.accept();
System.out.println("Connexion de :" + clientSocket.getInetAddress());
+ //Launch the text broadcasting server
Thread serviceThread = new Thread(new BroadcastThreadService(clientSocket));
+ //Or lauch the object broadcasting server
//Thread serviceThread = new Thread(new BroadcastoThreadService(clientSocket));
serviceThread.start();
}
grant {
permission java.net.SocketPermission "*:1024-65535", "connect, accept, resolve";
permission java.net.SocketPermission "*:80", "connect";
+ //permission java.security.AllPermission;
};
--- /dev/null
+#!/bin/sh
+
+java -cp . \
+ -Djava.security.policy=/home/fraggle/src/TD_SR-git/TD3/exemples/javarmi/hello/security.policy \
+ -Djava.rmi.server.codebase=file:/home/fraggle/src/TD_SR-git/TD3/ \
+ exemples.javarmi.hello.HelloClient 127.0.0.1 1099
--- /dev/null
+#!/bin/sh
+
+java -cp . \
+ -Djava.security.policy=/home/fraggle/src/TD_SR-git/TD3/exemples/javarmi/hello/security.policy \
+ -Djava.rmi.server.codebase=file:/home/fraggle/src/TD_SR-git/TD3/ \
+ exemples.javarmi.hello.HelloServer