我在cocos,socket链接成功,要发个int32,在开发者工具能发送成功,手机端无论ios或者安卓都不能发送出去
if (this.isConnect()) {
console.log("发送服务器ID:" + this._socket.url);
let binary = new Int32Array(new ArrayBuffer(32));
binary[0] = serverId;
this._socket.send(binary);
}
else {
console.log("发送服务器ID的时候还没连上:");
}
我也遇到这个问题,开发者工具能发送成功,网页也成功,微信小游戏真机不行:
send(buf:Buffer){ if (this.websocket == undefined) { console.error('this.websocket is undefined') return } this.websocket.send(buf.buffer)//这样可以发 //this.websocket.send(buf) 这样好像微信小游戏真机发不出任何消息(微信开发者工具发送成功,网页也成功),原因不明 }
同样遇到这个问题,请问楼主咋解决的,求教!!!