Quelqu'un at-il utiliser cocos2d js avec ips?Cocos2d js (Cocos2d x 3.14) sur android avec deepstream io
J'ai essayé d'utiliser js client deepstream mais il semble être l'échec lorsque vous essayez de se connecter au serveur via le réseau (websocket):
c'est journal adb:
06-06 09:43:19.227: D/cocos2d-x debug info(26288): connectDeepStream [object Object] [email protected]/src/modules/Actions/Player.js:22:13,
06-06 09:43:19.232: D/WebSocket.cpp(26288): WebSocket thread start, helper instance: 0x97987760
06-06 09:43:19.237: D/WebSocket.cpp(26288): NOTICE: Initial logging level 911
06-06 09:43:19.237: D/WebSocket.cpp(26288): NOTICE: Libwebsockets version: 2.1.0 [email protected]
06-06 09:43:19.237: D/WebSocket.cpp(26288): NOTICE: IPV6 compiled in and enabled
06-06 09:43:19.237: D/WebSocket.cpp(26288): NOTICE: libev support not compiled in
06-06 09:43:19.237: D/WebSocket.cpp(26288): NOTICE: libuv support not compiled in
06-06 09:43:19.237: D/WebSocket.cpp(26288): NOTICE: Threads: 1 each 1024 fds
06-06 09:43:19.237: D/WebSocket.cpp(26288): NOTICE: mem: platform fd map: 4096 bytes
06-06 09:43:19.237: D/WebSocket.cpp(26288): NOTICE: Compiled with OpenSSL support
06-06 09:43:19.247: D/WebSocket.cpp(26288): NOTICE: mem: per-conn:
376 bytes + protocol rx buf06-06 09:43:19.247: D/WebSocket.cpp(26288): protocol: ws, host: ...*, port: 3512, path: deepstream
06-06 09:43:19.247: D/WebSocket.cpp(26288): NOTICE: Creating Vhost 'default' port -1, 1 protocols, IPv6 on
06-06 09:43:19.252: D/WebSocket.cpp(26288): NOTICE: lws_protocol_init
06-06 09:43:19.252: D/WebSocket.cpp(26288): WebSocket (0xae824ed0) Unhandled websocket event: 32
06-06 09:43:19.252: D/WebSocket.cpp(26288): WebSocket (0xae824ed0) Unhandled websocket event: 29
06-06 09:43:19.257: D/WebSocket.cpp(26288): WebSocket (0xae824ed0) Unhandled websocket event: 24
06-06 09:43:19.267: D/WebSocket.cpp(26288): WebSocket (0xae824ed0) onConnectionError, state: 0 ...
06-06 09:43:19.267: D/WebSocket.cpp(26288): WebSocket (0xae824ed0) onConnectionClosed, state: 2 ...
06-06 09:43:19.267: D/WebSocket.cpp(26288): onConnectionClosed, WebSocket (0xae824ed0) is closing by server.
06-06 09:43:19.267: D/WebSocket.cpp(26288): WebSocket (0xae824ed0) onConnectionClosed DONE!
06-06 09:43:19.267: D/WebSocket.cpp(26288): WebSocket (0xae824ed0) Unhandled websocket event: 45
06-06 09:43:19.267: D/WebSocket.cpp(26288): WebSocket (0xae824ed0) Unhandled websocket event: 33
06-06 09:43:19.267: D/WebSocket.cpp(26288): WebSocket (0xae824ed0) onConnectionClosed, state: 3 ...
06-06 09:43:19.282: D/cocos2d-x debug info(26288): _onError [object Object] object
06-06 09:43:19.282: D/cocos2d-x debug info(26288): [object Object]
06-06 09:43:19.282: D/cocos2d-x debug info(26288): {"type":"error"}
06-06 09:43:19.287: D/WebSocket.cpp(26288): In the destructor of WebSocket (0xae824ed0)
06-06 09:43:19.287: D/WebSocket.cpp(26288): before join ws thread
06-06 09:43:19.292: D/WebSocket.cpp(26288): NOTICE: lws_context_destroy
06-06 09:43:19.292: D/WebSocket.cpp(26288): WebSocket thread exit, helper instance: 0x97987760
06-06 09:43:19.292: D/WebSocket.cpp(26288): after join ws thread
06-06 09:43:19.317: D/cocos2d-x debug info(26288): C connectionError [object Object] string
06-06 09:43:19.317: D/cocos2d-x debug info(26288): error: string
06-06 09:43:19.317: D/cocos2d-x debug info(26288): [object Object]
06-06 09:43:19.317: D/cocos2d-x debug info(26288): connectionError
06-06 09:43:19.317: D/cocos2d-x debug info(26288): C
j'ai essayé de connecter le contenu de erreur, mais c'est seulement "{" type ":" erreur "}".
Le code est si simple. Je commence seulement un serveur deepstream et essaie de se connecter au serveur sur le client Android (js cocos2d-js)
comme ceci:
this.client = deepstream(CCDefine.DeepStreamServer).login({username: arg.username, password: arg.password},function(success,data){
cc.log(success,data)
if(success){
cc.log('Deep stream connect success')
}else{
cc.log('Deep stream connect false')
}
})
Je trouve que libwebsockets cocos utilisation sans libuv tout en deepstream utiliser. peut-il problème? J'ai essayé de compiler libwebsockets avec libuv pour android mais j'ai échoué.