Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 90847

Creator3.3.0 Windows原生环境(x64)下WebSocket报错,无法建立连接

$
0
0

在3.3.0下新建项目,执行如下代码:
this._sock = new WebSocket(this._serverPath);
this._sock.binaryType = “arraybuffer”;
this._sock.onopen = this.onOpen.bind(this);
this._sock.onmessage = this.onMessage.bind(this);
this._sock.onerror = this.onError.bind(this);
this._sock.onclose = this.onClose.bind(this);

在网页以及win32环境下执行没有异常,但是构建成windows(x64)项目,用vs运行会输出下列信息:
WebSocket (000001BD24A96300) onConnectionError, state: 0
WebSocket (000001BD24A96300) onConnectionClosed, state: 2
onConnectionClosed, WebSocket (000001BD24A96300) is closing by server.

JS会回调onError方法,WebSocket也会随之关闭,服务端也无法收到客户端的消息。

同样的项目在2.4.5、3.1.2、3.2.0、3.2.1以及3.3.0win32中都是可以正常连接的。将防火墙和杀毒软件关闭也是同样的结果。
x64是3.3.0新加的,会不会在这方面有什么漏洞?

1 个帖 - 1 位参与者

阅读整个主题


Viewing all articles
Browse latest Browse all 90847

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>