最近遇到同样的问题,解决方法,你可以试着不绑定端口。使用随机端口,我这样问题已经解决了,真机测试ok
如何解除绑定小程序UDP通信绑定的端口,绑定过固定端口之后刷新小程序会报端口占用的错,求解,谁会?[图片]
2023-01-05问题解决了吗?
socket 在真机bind 为 0?基础库:2.25.0 手机:安卓和ios都不可以 UDPSocket.bind(number port) 在开发者工具没问题,但在真机显示值为0, UDPSocket.close()也报错 this.udpSocket = uni.createUDPSocket(); if (this.udpSocket === null) { console.log('暂不支持'); return; } setTimeout(() => { const locationPort = this.udpSocket.bind(10012) console.log(locationPort); },1000) this.udpSocket.onListening(function(res){ console.log('监听中.......'); console.log(res); }) this.udpSocket.onError(function(res) { console.log(res); }) this.udpSocket.onMessage(function(res) { // console.log(res.message); let a = that.newAb2Str(res.message); console.log(a); })
2023-01-05我是用真机调试,正常,再开发工具中,如果不勾选不校验域名,会出现异常,这种情况,我发布更新的话,会有影响吗?
小程序修改了域名后,只能再测试版上访问,正式版访问就出现异常,这是什么情况?第一版已经发布,后来更换服务器,更换域名后,在测试环境下正常,不校验域名也正常,正式版就出现request:fail 对应的服务器证书无效。控制台输入:showRequestInfo() 后显示securityState :insecure ,isSecuryCertificatet:false.这个证书再哪里配置。
2019-10-10