Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
D10NGYANG authored Aug 17, 2020
1 parent 4690c8b commit c5a43c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
包括以下功能:

1. udp广播;
2. udp组播测试
2. udp组播
3. Tcp客户端;
4. Tcp服务器;

Expand Down Expand Up @@ -81,6 +81,7 @@ val thread = UdpBroadThread(this, 12345, object : OnNetThreadListener{
// 接受到信息,ipAddress消息来源地址,port消息来源端口,time消息到达时间,data消息内容
}
})
thread.start()
// 发送数据
thread.send("192.168.1.123", 12345, data)
```
Expand Down Expand Up @@ -140,6 +141,7 @@ val thread = UdpMultiThread(this, "192.168.11.255", 12345, object : OnNetThreadL
// 接受到信息,ipAddress消息来源地址,port消息来源端口,time消息到达时间,data消息内容
}
})
thread.start()
// 发送数据
thread.send("192.168.11.255", "12345", data)
```
Expand Down Expand Up @@ -199,6 +201,7 @@ val thread = TcpClientThread("192.168.1.123", 12345, object : OnNetThreadListene
// 接受到信息,ipAddress消息来源地址,port消息来源端口,time消息到达时间,data消息内容
}
})
thread.start()
// 发送数据
thread.send(data)
```
Expand Down Expand Up @@ -258,6 +261,7 @@ val thread = TcpServerThread(12345, object : OnNetThreadListener{
// 接受到信息,ipAddress消息来源地址,port消息来源端口,time消息到达时间,data消息内容
}
})
thread.start()
// 发送数据给特定客户端
thread.send("192.168.11.255", "12345", data)
// 发送数据给全部已连接的客户端
Expand Down

0 comments on commit c5a43c5

Please sign in to comment.