// uts文件
export class UDPClient {
private static packetId : Byte = 0;
private host : InetAddress;
private port : Int;
// private socket : DatagramSocket | null = null;
constructor(host : string, port : Int) {
this.host = InetAddress.getByName(host);
this.port = port;
console.log(">>>>" + port);
}
}
demo.vue
const client1 = new UDPClient("255.255.255.255", 8000);
client1.send(msg, sendSuccessCallback, sendErrorCallback);
const client2 = new UDPClient("255.255.255.255", 8001);
client2.send(msg, sendSuccessCallback, sendErrorCallback);
const client3 = new UDPClient("255.255.255.255", 8002);
client3.send(msg, sendSuccessCallback, sendErrorCallback);
const client4 = new UDPClient("255.255.255.255", 8003);
client4.send(msg, sendSuccessCallback, sendErrorCallback);
1 个回复
DCloud_UNI_FXY
已确认,下个版本修复