From 3187608579ac0ccdf9b738305bb2b2775500eff8 Mon Sep 17 00:00:00 2001 From: ericek111 Date: Wed, 23 Sep 2026 23:21:52 +0000 Subject: [PATCH] Update ts3j: survive packet loss during the handshake; allow 30 s to connect Picks up the ts3j fixes for "mac check in EAX failed" disconnects on lossy links (retransmitted handshake packets now decrypt) and for the handshake stalling when clientek's ACK is lost, plus tolerating an empty client_servergroups. The connect timeout also covers downloading the channel list, which on a big server over mobile data can take longer than the previous 10 s. Co-Authored-By: Claude Opus 5.5 --- .../main/java/com/ts3client/net/TeamspeakConnection.java | 8 +++++++- ts3j | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ts3-client/core/src/main/java/com/ts3client/net/TeamspeakConnection.java b/ts3-client/core/src/main/java/com/ts3client/net/TeamspeakConnection.java index 83be9ae..c20fe82 100644 --- a/ts3-client/core/src/main/java/com/ts3client/net/TeamspeakConnection.java +++ b/ts3-client/core/src/main/java/com/ts3client/net/TeamspeakConnection.java @@ -63,6 +63,12 @@ public final class TeamspeakConnection implements TS3Listener { /** Shortest gap between two "you are talking while muted" reminders. */ private static final long MUTED_TALK_COOLDOWN_NANOS = 5_000_000_000L; + /** + * How long the handshake and initial download may take. That download includes the whole + * channel list, which on a big server over a lossy link (mobile data) takes a while. + */ + private static final long CONNECT_TIMEOUT_MS = 30_000L; + private final Settings settings; private final AudioBackend audio; private final ServerModel model = new ServerModel(); @@ -293,7 +299,7 @@ public final class TeamspeakConnection implements TS3Listener { ui.onStatus("Connecting to " + address + ":" + port + "…"); client.connect(new InetSocketAddress(address, port), (password == null || password.isEmpty()) ? null : password, - 10_000L); + CONNECT_TIMEOUT_MS); // Protocol connection established; anything past this point is best-effort. selfClientId = client.getClientId(); diff --git a/ts3j b/ts3j index b335c2c..45cb8fd 160000 --- a/ts3j +++ b/ts3j @@ -1 +1 @@ -Subproject commit b335c2c5115ee719207e3d157b6bc98f425c5a36 +Subproject commit 45cb8fd5595d01e0d54f511e31757ff04617e128