socket.io on('connection')触发没有实际连接

时间:2013-09-26 05:59:38

标签: node.js sockets socket.io

var http = require('http');
var express = require('express');
var app = express();

var server = http.createServer(app);
server.listen(3000);

var io = require('socket.io').listen(server);
io.set('log level', 1);
io.sockets.on('connection', function(socket) {
  console.log('connected');
});

运行后

node server.js

有时“已连接”会记录到控制台而没有实际连接,它来自何处?

0 个答案:

没有答案