1

我在我的网站上添加了用户端错误日志记录。有时它会记录来自 socket.io 代码的这种错误:

TypeError: this.transport is undefined

只有在 Windows 上使用 Firefox 15th 版本的用户才能看到该错误。

在服务器端,我这样定义我的传输:

this.io.configure(function(){
    self.io.set('transports', ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling']);
    self.io.set('log level', 0);
});

Socket.io 版本是 0.9.10。

你能告诉我这个错误的原因是什么吗?

任何帮助表示赞赏。

4

1 回答 1

0

configure方法用于为特定环境设置配置。您没有指定环境,因此您可以删除configure回调函数并简单地执行以下操作:

this.io.set('transports', ['websocket', 'flashsocket', 'htmlfile', 'xhr-polling', 'jsonp-polling']);
this.io.set('log level', 0);
于 2012-10-04T09:59:04.913 回答