diff --git a/ChatApp/app/src/main/java/client/ClientGuiController.java b/ChatApp/app/src/main/java/client/ClientGuiController.java index 786a84f..9d72e1a 100644 --- a/ChatApp/app/src/main/java/client/ClientGuiController.java +++ b/ChatApp/app/src/main/java/client/ClientGuiController.java @@ -53,7 +53,7 @@ public class ClientGuiController implements ClientListener { @FXML public void initialize() throws SocketException { - client = new Client(new InetSocketAddress("localhost", 6665), this, UsernameSingleton.getInstance().getUsername()); + client = new Client(new InetSocketAddress("192.168.163.131", 6665), this, UsernameSingleton.getInstance().getUsername()); Platform.runLater(() -> { Stage stage = (Stage) vueContainer.getScene().getWindow(); stage.setResizable(true); // Fixed a bug that made the close button disappear under my Wayland setup (don't know if it's the same for x11) @@ -71,7 +71,7 @@ public class ClientGuiController implements ClientListener { * Request the list of rooms from the server every second. */ private void requestRoomsRegularly() { - Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(1), event -> client.RequestRoomList())); + Timeline timeline = new Timeline(new KeyFrame(Duration.seconds(10), event -> client.RequestRoomList())); timeline.setCycleCount(Timeline.INDEFINITE); timeline.play(); } diff --git a/ChatApp/app/src/main/java/network/PacketPool.java b/ChatApp/app/src/main/java/network/PacketPool.java index be3c444..374c93c 100644 --- a/ChatApp/app/src/main/java/network/PacketPool.java +++ b/ChatApp/app/src/main/java/network/PacketPool.java @@ -25,7 +25,7 @@ public class PacketPool { private static int MAX_SEND_TRY = 50; private static long SEND_DELAY = 10; private static long RETRY_INTERVAL = SEND_DELAY * 2; - private static float PACKET_LOSS_PROBABILITY = 0.0f; + private static float PACKET_LOSS_PROBABILITY = 0.1f; private static record ReliablePacketAddress(ReliablePacket packet, InetSocketAddress address) { @Override @@ -97,7 +97,7 @@ public class PacketPool { } private void debugPrint(String msg) { - System.out.println(msg); +// System.out.println(msg); } private void debugSend(ReliablePacket packet, InetSocketAddress address) {