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
2 回复
你好,请提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)