- TCPSocket.onMessage断开连接,再重连后.onMessage消息重复?
用户主动断开后,再重连,onMessage消息重复出现 [图片] //TCP连接 按键 connectSocketFunciton() { var that = this var address = that.globalData.inputIP var port=that.globalData.inputPort console.log(address,port) tcp.connect({ address:address, port:port, timeout:3, }) tcp.onError((e)=>{ console.log(e) let iszhuangtai=false that.callzt(iszhuangtai) wx.showToast({ title: "连接失败", icon: 'none', duration: 2000,//持续的时间 }) }) //TCP监听 tcp.onMessage((e)=>{ var util=require('pages/utils/util.js') var that = this var time= util.formatDate(new Date()); // console.log(e.message) var jieshou= e.remoteInfo var buffer = e.message; var dataview = new DataView(buffer); var ints = new Uint8Array(buffer.byteLength); var str = '',ceshi=''; for (var i = 0; i < ints.length; i++) { str+= String.fromCharCode(dataview.getUint8(i)); } console.log("直接接受的消息,未处理",e) console.log(str ,jieshou) var shuju="@["+jieshou.address+"]-" +time+':\n'+ str this.globalData.message=shuju // if (this.onMessage) this.onMessage(shuju); that.callback(shuju) return str }) }, //断开连接 tcpcloce(res){ var that =this tcp.close() //this.onMessage =null // tcp.onMessage = null; that.globalData.iszhuangtai = false wx.showToast({ title: "连接断开", icon: 'none', duration: 2000,//持续的时间 }) },
2023-06-16 - 实时播放音视频流 (未符合开通条件),怎么算才符合条件????
https://developers.weixin.qq.com/miniprogram/dev/component/live-player.html 实时播放音视频流 (未符合开通条件),怎么算才符合条件????
2022-12-06 - 新的创作打开什么都没有?
谷歌浏览器,85版本的,点击新的创作,打开只有公众号标题,然后下面都是空白[图片]
2020-10-27