native平台SocketIO问题,纠结很久了。。

var opts = {
        'reconnection': false,
        'force new connection': true,
        'transports': ['websocket', 'polling']
    };

    //if (cc.sys.isNative)
    //    window.io = SocketIO;


    this.sio = window.io.connect(ipport, opts);


    this.sio.on('connect', function (data) {
        cc.find("Canvas/1234").getComponent(cc.Label).string = "connected to server";
    });

    this.sio.on('disconnect', function (data) {
        console.log("disconnect!!!!!");
        cc.find("Canvas/1234").getComponent(cc.Label).string = "disconnected from server";

    });

    this.sio.on('tstcmd', function (data) {
        console.log("tstcmd:" + JSON.stringify(data));

        cc.find("Canvas/1234").getComponent(cc.Label).string = JSON.stringify(data);

    });

socketio在原生平台连接nodejs后端,nodejs后端接受到了connect事件,但客户端立刻返回disconnect事件。以上代码在浏览器调试平台运行正常,查了很久也没查到问题
另外,creator集成的SocketIO库相关接口在IPV6问题上能过审吗。。

http://forum.cocos.com/search?q=socketio%20category%3A27

看看有没有能帮到你的结果

谢啦,creator的socketio和nodejs版本问题。请教一下creator自带的socketio组件在ios平台用,能通过ipv6审核吗。。。

不好意思我没用过,只有等官方大神或者用过的大神来回答你这个问题

试了一下,果然是版本的坑,node改成低版本的socketio就能连了。。。。