From a8c3ca4f1d9433e914325222ae5f26da2f9e2489 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期四, 14 九月 2023 18:05:37 +0800 Subject: [PATCH] 增加了住宅id功能 --- 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