@alchimya wrote:
With Cocos Creator 1.1.2, trying using WebSocket, I get the following error with an iOS build using the device, instead it works fine using the Xcode simulator and/or the web browser.
[WebSocket::init] _host: localhost, _port: 8080, _path: /
WebSocket::onSubThreadStarted, instance: 0x15dea3820
NOTICE: Initial logging level 967
NOTICE: Libwebsockets version: 1.7.8 linwenhai@LindeMacBook-Pro.local-v3.4-49-g9369eea
NOTICE: IPV6 compiled in and enabled
NOTICE: libev support not compiled in
NOTICE: Threads: 1 each 256 fds
NOTICE: mem: platform fd map: 2048 bytes
NOTICE: mem: per-conn: 368 bytes + protocol rx buf
WebSocket (0x15dea3820) onConnectionError ...
Ready state is closing or was closed, code=2, quit websocket thread!
NOTICE: lws_context_destroy
WebSocket (0x15dea3820) onConnectionClosed ...
WebSocket::onSubThreadEnded, instance: 0x15dea3820
In the destructor of WebSocket (0x15dea3820)My source code is extremely simple:
ws = new WebSocket("ws://localhost:8080"); ws.onopen = function (event) { console.log("Send Text WS was opened."); };
Posts: 3
Participants: 2