| | |
| | | * @param port 目的端口
|
| | | * @param linkRequest 发送的数据
|
| | | * @param observeTopic 发送的主题
|
| | | * @param retry 重发数次
|
| | | * @param listener 回调
|
| | | */
|
| | | public static void send(UdpSocketBoot udpSocketBoot, String ipAddress ,int port, LinkRequest linkRequest, String observeTopic, HdlSocketListener listener) {
|
| | | public static void sendUdp(UdpSocketBoot udpSocketBoot, String ipAddress ,int port, LinkRequest linkRequest, String observeTopic, int retry,HdlSocketListener listener) {
|
| | | if (TextUtils.isEmpty(observeTopic)) {
|
| | | observeTopic = linkRequest.getTopic() + "_reply";
|
| | | }
|
| | | HdlSocketHelper socketHelper = new HdlSocketHelper(DEF_SEND_TIMEOUT, DEF_SEND_ONE, udpSocketBoot, ipAddress,port, linkRequest, observeTopic, listener);
|
| | | HdlSocketHelper socketHelper = new HdlSocketHelper(DEF_SEND_TIMEOUT, retry, udpSocketBoot, ipAddress,port, linkRequest, observeTopic, listener);
|
| | | socketHelper.send();
|
| | | }
|
| | |
|
| | | /**
|
| | | * Udp发送的方法
|
| | | * Udp的发送方法
|
| | | *
|
| | | * @param udpSocketBoot 当前Udp对象
|
| | | * @param udpSocketBoot Udp当前对接
|
| | | * @param ipAddress 发送的目标IP地址
|
| | | * @param
|
| | | * @param linkRequest 发送的对象
|
| | | * @param port 目的端口
|
| | | * @param linkRequest 发送的数据
|
| | | * @param listener 回调
|
| | | */
|
| | | public static void send(UdpSocketBoot udpSocketBoot, String ipAddress ,int port, LinkRequest linkRequest, HdlSocketListener listener) {
|
| | | String observeTopic = null;
|
| | | if (TextUtils.isEmpty(observeTopic)) {
|
| | | observeTopic = linkRequest.getTopic() + "_reply";
|
| | | }
|
| | | HdlSocketHelper socketHelper = new HdlSocketHelper(DEF_SEND_TIMEOUT, DEF_SEND_ONE, udpSocketBoot, ipAddress,port, linkRequest, observeTopic, listener);
|
| | | socketHelper.send();
|
| | | public static void sendUdp(UdpSocketBoot udpSocketBoot, String ipAddress ,int port, LinkRequest linkRequest, HdlSocketListener listener) {
|
| | | sendUdp(udpSocketBoot,ipAddress,port,linkRequest,null,DEF_MAX_RETRY,listener);
|
| | | }
|
| | |
|
| | | /**
|
| | | * Udp的发送方法
|
| | | *
|
| | | * @param udpSocketBoot Udp当前对接
|
| | | * @param ipAddress 发送的目标IP地址
|
| | | * @param port 目的端口
|
| | | * @param linkRequest 发送的数据
|
| | | */
|
| | | public static void sendUdpOne(UdpSocketBoot udpSocketBoot, String ipAddress ,int port, LinkRequest linkRequest) {
|
| | | sendUdp(udpSocketBoot, ipAddress, port, linkRequest, null, DEF_SEND_ONE, null);
|
| | | }
|
| | |
|
| | | private void send() {
|