初始化udp新增安全判断

This commit is contained in:
Daisy 2024-04-17 09:42:25 +08:00
parent 44f11670d9
commit dca3946970

View File

@ -42,13 +42,16 @@ class UDPManage {
int remoteUnlock = 0; // 1 0 int remoteUnlock = 0; // 1 0
void initUdp() async { void initUdp() async {
var listAddress = InternetAddress.lookup(host!); if (host != '') {
listAddress.then((list) { var listAddress = InternetAddress.lookup(host);
list.forEach((element) { listAddress.then((list) {
// print('Udp ----> element.address:${element.address} element.host:${element.host}'); list.forEach((element) {
host = element.address; // print('Udp ----> element.address:${element.address} element.host:${element.host}');
host = element.address;
});
}); });
}); }
await _initUdp(); await _initUdp();
} }