I am on Node.js v4.1.1 and working with socket.io
when the client connected to the server socket and started exchanging packets at the moment when the first packet missed the server.
Do you have any ideas what is the reason for this? Please note that we have about 900 connections at a time.
var http = module.exports = require('http');
var app = module.exports = express();
var httpsOptions = {
key: fs.readFileSync('server.key'),
cert: fs.readFileSync('certificate.crt')
};
var Server = https.createServer(httpsOptions, app);
var io = module.exports = require('socket.io').listen(Server);
io.set("transports", ["xhr-polling", "web socket", "polling", "htmlfile"]);
io.sockets.on("connection", function(socket)
{
client.on('msg', function(request)
{
console.log("event get --> " + request);
});
client.on('error', function(exc)
{
console.log("ignoring exception: " + exc);
});
client.on('ping', function(request)
{
client.emit('pong', request);
client.removeListener('ping', function() {});
});
client.on('disconnect', function(reason)
{
console.log("socket disconnect " + reason);
});
});
source
share