Chrome hangs after certain amount of data transfered – waiting for available socket

Explanation: This problem occurs because Chrome allows up to 6 open connections by default. So if you’re streaming multiple media files simultaneously from 6 <video> or <audio> tags, the 7th connection (for example, an image) will just hang, until one of the sockets opens up. Usually, an open connection will close after 5 minutes of … Read more

socket.emit() vs. socket.send()

With socket.emit you can register custom event like that: server: var io = require(‘socket.io’).listen(80); io.sockets.on(‘connection’, function (socket) { socket.emit(‘news’, { hello: ‘world’ }); socket.on(‘my other event’, function (data) { console.log(data); }); }); client: var socket = io.connect(‘http://localhost’); socket.on(‘news’, function (data) { console.log(data); socket.emit(‘my other event’, { my: ‘data’ }); }); Socket.send does the same, but … Read more