Files
Projet-UDP/ChatApp/app/src/main/java/ChatApp.java
2025-03-10 13:51:48 +01:00

24 lines
630 B
Java

import java.net.InetSocketAddress;
import client.ClientConsole;
import server.Server;
public class ChatApp {
public static void main(String[] args) throws Exception {
Server server = new Server(6665);
ClientConsole client = new ClientConsole(new InetSocketAddress("localhost", 6665));
client.onConnect.connect((arg) -> {
client.getClientInterface().SendCreateRoom("101");
});
client.onDisconnect.connect((arg) -> {
System.out.println("Stopping server ...");
server.close();
System.out.println("Done !");
});
}
}