562935844@qq.com
2023-08-31 fdcf461fbfa3bcd650685743e891ad3357898f0c
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("初始化Socket 失败:" + e.getMessage());
@@ -154,7 +156,7 @@
            if (handleMessage != null) {
                byte[] data = new byte[receivePacket.getLength()];
                System.arraycopy(receivePacket.getData(), 0, data, 0, data.length);
                handleMessage.read(data);
                handleMessage.read(data,receivePacket.getAddress().getHostAddress());
            }
        } catch (Exception e) {