STT流式输入业务逻辑处理

This commit is contained in:
2025-10-18 23:46:31 +08:00
parent 6d0a08fcaa
commit d46581e1dc

View File

@@ -353,18 +353,18 @@ public class ChatWebSocketHandler {
@Override @Override
public void onFailure(WebSocket webSocket, Throwable t, Response response) { public void onFailure(WebSocket webSocket, Throwable t, Response response) {
System.err.println("❌ 连接失败: " + t.getMessage()); System.err.println("❌ 连接失败: " + t.getMessage());
latch.countDown(); // latch.countDown();
} }
@Override @Override
public void onClosing(WebSocket webSocket, int code, String reason) { public void onClosing(WebSocket webSocket, int code, String reason) {
System.out.println("⚠️ 连接即将关闭: " + reason); System.out.println("⚠️ 连接即将关闭: " + reason);
webSocket.close(1000, null); webSocket.close(1000, null);
latch.countDown(); // latch.countDown();
} }
}); });
// 等待 WebSocket 关闭 // 等待 WebSocket 关闭
latch.await(); // latch.await();
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }