From cc0421a5d9b1b7f19f6c8e39e4756b95345f1623 Mon Sep 17 00:00:00 2001 From: panlili2024 <14743743+panlili2024@user.noreply.gitee.com> Date: 星期二, 25 二月 2025 18:04:23 +0800 Subject: [PATCH] sdk demo优化 --- HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/client/UdpClient.java | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/client/UdpClient.java b/HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/client/UdpClient.java index 07d368d..8a78384 100644 --- a/HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/client/UdpClient.java +++ b/HDLSDK/hdl-socket/src/main/java/com/hdl/sdk/socket/client/UdpClient.java @@ -87,7 +87,7 @@ * @return */ public static UdpSocketBoot init(int port, UdpSocketOptions options) { - return init(null, port, options); + return init("0.0.0.0", port, options); } @@ -100,9 +100,11 @@ } if (TextUtils.isEmpty(ipAddress)) { mSocket = SocketPool.getInstance().getUdpSocket(new InetSocketAddress(port)); + }else { + mSocket = SocketPool.getInstance().getUdpSocket(new InetSocketAddress(ipAddress,port)); } mSocket.setBroadcast(true); - mSocket.setReuseAddress(true); +// mSocket.setReuseAddress(true); } catch (Exception e) { LogUtils.e("鍒濆鍖朣ocket 澶辫触锛�" + e.getMessage()); -- Gitblit v1.8.0