Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simulator 调试的时候用 SocketIO.connect 报了 Microsoft Visual C++ .exe R6010 abort error #1251

Closed
abos5 opened this issue Oct 29, 2016 · 4 comments

Comments

@abos5
Copy link

abos5 commented Oct 29, 2016

如题

image

CCC 1.3.0 console 信息:
image

代码如下:
(在谷歌浏览器下工作正常)
plugin:

(function (root) {
    // 绑定 dragon planet 的全局库
    let dp = {
        remote: {
            single: null,
            init: function (host) {
                if (cc.sys.isNative) {
                    this.single = root.io.connect(host)
                } else {
                    this.single = root.io(host)
                }
            }
        }
    }
    root.dp = dp
    if (cc.sys.isNative) {
        root.io = SocketIO
    } else if (typeof io === 'undefined') {
        root.io = require('socket.io-client')
    } else {
        root.io = io
    }

})(this)

Game.js

   dp.remote.init('ws://xxx:3000/star');

备注: sample 里的 network 代码是可以正常执行的

@abos5
Copy link
Author

abos5 commented Oct 29, 2016

根据 sample 1.3 network 里的介绍, 将 socket-io.js 做为plugin,
且 socketio 的请求 都使用 io.connect('ws://xxx.space:3000') 也是会报 R6010

@jareguo
Copy link
Contributor

jareguo commented Oct 30, 2016

能不能试试 http scheme?

@abos5
Copy link
Author

abos5 commented Oct 30, 2016

改为 http 之后的 调试信息:

image

修改之后的代码(在浏览器上是正常运行的):
image

@abos5
Copy link
Author

abos5 commented Oct 30, 2016

上面的错误信息是 直接使用了nginx配置的upstream, 在 simulator 下handshake失败了;
刚刚改为 host+端口号直连, 现在在simulator里面也正常了...
handshake失败的应该是和我后端socketio, koajs 或者nginx 那边再调一下

但windows的 R6010 这个问题, 代码没有修改, 睡一觉起来就好了...怪怪的

@nantas nantas closed this as completed Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants