Files
TP1-Arsir/src/Ex5/App.java
2026-02-04 10:14:53 +01:00

23 lines
687 B
Java

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);
}
}
}