UDPSocket.onMessage 无法接收消息?
UDPSocket.onMessage 在不先调用 UDPSocket.send 无法接受消息that.udpSocket = wx.createUDPSocket();
that.udpSocket.bind(35675);
that.udpSocket.send({
address: '192.168.1.120',
port: 54321,
message: "hello world!"
});
that.udpSocket.onListening(function(res) {
console.log(res);
});
that.udpSocket.onMessage(function(res) {
console.log(res.message);
console.log(res.remoteInfo.address);
console.log(res.remoteInfo.port);
console.log(res.remoteInfo.size);
});
//基础库2.10.2