From: Jérôme Benoit Date: Fri, 16 Mar 2018 15:12:18 +0000 (+0100) Subject: TD3: Add RMI helloworld helper scripts. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ae09e645684a4f53aad5566f811ab7e99d6b68ac;p=TD_SR.git TD3: Add RMI helloworld helper scripts. Signed-off-by: Jérôme Benoit --- diff --git a/TD2/server/Main.java b/TD2/server/Main.java index 12aed42..c951e81 100644 --- a/TD2/server/Main.java +++ b/TD2/server/Main.java @@ -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 index 0000000..41ec8ce --- /dev/null +++ b/TD3/build_hello.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +javac exemples/javarmi/hello/*.java diff --git a/TD3/exemples/javarmi/hello/security.policy b/TD3/exemples/javarmi/hello/security.policy index 8ae3813..2ed1ae4 100644 --- a/TD3/exemples/javarmi/hello/security.policy +++ b/TD3/exemples/javarmi/hello/security.policy @@ -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 index 0000000..3c6b7d1 --- /dev/null +++ b/TD3/start_hello_client.sh @@ -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 index 0000000..fffee9b --- /dev/null +++ b/TD3/start_hello_server.sh @@ -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