this.udpObj=wx.createUDPSocket();
this.udpObj.bind();
this.udpObj.send({
address: '192.168.193.2',
port: 8848,
message: 'hello, how are you'
})
this.udpObj.onListening(function(res){
console.log('监听中...')
console.log(res)
})
this.udpObj.onError(res=>{
console.log("error")
console.log(res)
})
this.udpObj.onMessage(res=>{
console.log("收到udp包的消息")
console.log(res);
})
{errMsg: "send: fail sendUDPSocketMessage:fail The "buffer" …r, Uint8Array, or string. Received type undefined"}errMsg: "send: fail sendUDPSocketMessage:fail The "buffer" argument must be one of type Buffer, Uint8Array, or string. Received type undefined"__proto__: Object
我也遇到一样的问题了,请问楼主解决了么?
send: fail sendUDPSocketMessage:fail The "buffer" argument must be one of type Buffer, Uint8Array, or string. Received type undefined
这是我的报错信息
你好,请更新微信版本后重试。若还有问题,请提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)