hxb
2021-12-21 93f13e7b2e046c6d86d10e7abc2ecaa4c4adabc3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.hdl.sdk.socket.client;
 
import com.hdl.sdk.socket.SocketOptions;
import com.hdl.sdk.socket.udp.UdpSocketOptions;
 
import java.net.InetSocketAddress;
import java.net.SocketAddress;
 
/**
 * Created by hxb on 2021/12/12.
 */
public interface IUdpClient {
 
    /**
     * 绑定端口
     */
    void bind() throws Exception;
 
    /**
     * 关闭当前连接
     * @return
     */
    boolean close();
 
 
    UdpSocketOptions getOptions();
 
    /**
     * 监听数据
     */
    void onHandleResponse() throws Exception;
 
    /**
     * 发送数据
     * @param ipAddress 目标IP
     * @param port 端口
     * @param msg 发送数据
     * @throws Exception
     */
    void sendMsg(String ipAddress,int port, byte[] msg) throws Exception;
 
}