From ae09e645684a4f53aad5566f811ab7e99d6b68ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 16 Mar 2018 16:12:18 +0100 Subject: [PATCH] TD3: Add RMI helloworld helper scripts. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- TD2/server/Main.java | 5 ++++- TD3/build_hello.sh | 3 +++ TD3/exemples/javarmi/hello/security.policy | 1 + TD3/start_hello_client.sh | 6 ++++++ TD3/start_hello_server.sh | 6 ++++++ 5 files changed, 20 insertions(+), 1 deletion(-) create mode 100755 TD3/build_hello.sh create mode 100755 TD3/start_hello_client.sh create mode 100755 TD3/start_hello_server.sh 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 -- 2.34.1