TD3: Add RMI helloworld helper scripts.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 16 Mar 2018 15:12:18 +0000 (16:12 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 16 Mar 2018 15:12:18 +0000 (16:12 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
TD2/server/Main.java
TD3/build_hello.sh [new file with mode: 0755]
TD3/exemples/javarmi/hello/security.policy
TD3/start_hello_client.sh [new file with mode: 0755]
TD3/start_hello_server.sh [new file with mode: 0755]

index 12aed42f8414855da82c7f64b50eda230b103b12..c951e81a1a951ea0a1114924bef6894990b3c368 100644 (file)
@@ -5,12 +5,15 @@ public class Main {
        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();
                        }
diff --git a/TD3/build_hello.sh b/TD3/build_hello.sh
new file mode 100755 (executable)
index 0000000..41ec8ce
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+javac exemples/javarmi/hello/*.java
index 8ae38132793c698e328ba76d8cd1b55a4d1ce764..2ed1ae4c305bb7a0ddfc7575b82d47836df44888 100644 (file)
@@ -1,4 +1,5 @@
 grant {
     permission java.net.SocketPermission "*:1024-65535", "connect, accept, resolve";
     permission java.net.SocketPermission "*:80", "connect";
+    //permission java.security.AllPermission;
 };
diff --git a/TD3/start_hello_client.sh b/TD3/start_hello_client.sh
new file mode 100755 (executable)
index 0000000..3c6b7d1
--- /dev/null
@@ -0,0 +1,6 @@
+#!/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
diff --git a/TD3/start_hello_server.sh b/TD3/start_hello_server.sh
new file mode 100755 (executable)
index 0000000..fffee9b
--- /dev/null
@@ -0,0 +1,6 @@
+#!/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