• 首页
  • 动态
  • 案例
  • 引擎社区
  • API
  • 文档
  • 示例
  • 引擎下载

大约有 5 项符合查询结果, 库内数据总量为 31,560 项。 (搜索耗时: 0.0022 秒)

1. Socket能连接到服务器,客户端发请求也能收到服务端的数据,但是服务端主动推送数据,客户端就是收不到数据? [ 100%]

...ocket.on(Event.CLOSE, this, onSocketClose); socket.on(Event.MESSAGE, this, onMessageReveived); socket.on(Event.ERROR, this, onConnectError); socket.connectByUrl(url); } public function Add(handler:IHandler):void { if(list.indexOf(handler) < 0){ list.push(handler); } } public function Remove(handl...

来源: Laya_社区 发布时间: 20170724

2. QQ玩一玩 API 中没有 BKLaya.tools.BinaryLoader 的定义 [ 95%]

...on(){ function BKWebSocket(url){ this._socket=null; this.onopen=null; this.onmessage=null; this.onclose=null; this.onerror=null; this._socket=new BK.WebSocket(url); var _self; _self=this; this._socket.onClose=function (ws){ if (_self.onclose !=null){ _self.onclose(); } } this._socket.onOpen=function...

来源: Laya_社区 发布时间: 20180328

3. native 1.0.2 连不上wss [ 71%]

...onnect success~"); ws.send('tom'); alert("send to server msg: tom"); }; ws.onmessage = function(e) { alert("accpet msg: " + e.data); }; ws.onerror = function(e) { alert("error: " + e); console.log(e) }; </script> </body> </html>   这是app设置的url所对应的html文件,在w...

来源: Laya_社区 发布时间: 20181018

4. js如何解析nettywebsocket发的二进制数据中的utf8汉字 [ 60%]

...til.UTF_8); int len = b.length; bf.writeInt(len); bf.writeBytes(b); js: ws.onmessage = function (e) { var view=new DataView(e.data); console.log(view.byteLength);//7 console.log(view.getInt32(0));//3 console.log(view.getInt8(4),view.getInt8(5),view.getInt8(6));// -28 -67 -96 console.log(new Uint8Arr...

来源: Laya_社区 发布时间: 20180302

5. socket大型项目回调 [ 46%]

...RROR, this, this.onIOError); this.socket.on(Laya.Event.MESSAGE, this, this.onMessage); this.socket.connect(host,port); } public on(event, fn){ (this._callbacks[event] = this._callbacks[event] || []).push(fn); } public request(route, msg, cb) { if(arguments.length === 2 && typeof msg === 'fun...

来源: Laya_社区 发布时间: 20180119