This commit is contained in:
2026-02-04 10:14:53 +01:00
parent 22a11a0fa6
commit 77df0f8298
3 changed files with 132 additions and 0 deletions

22
src/Ex5/App.java Normal file
View File

@@ -0,0 +1,22 @@
package Ex5;
import java.net.InetSocketAddress;
import java.util.Scanner;
public class App {
public static void main(String[] args) throws Exception {
Server server = new Server(6666);
Client client = new Client(new InetSocketAddress("localhost", 6666));
Scanner scanner = new Scanner(System.in);
System.out.println("Entrez des messages :");
while (true) {
String line = scanner.nextLine();
System.out.println("[Client -> Server] " + line);
client.sendMessage(line);
String response = client.readMessage();
System.out.println("[Client <- Server] " + response);
}
}
}