| | |
| | | * @return
|
| | | */
|
| | | public static UdpSocketBoot init(int port, UdpSocketOptions options) {
|
| | | return init(null, port, options);
|
| | | return init("0.0.0.0", port, options);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | | 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());
|