Also found this, it seems that there was a bug in the socket.io version 0.9.5, which resulted in this delay:
stackoverflow.com/questions/12043893/socket-io-force-a-disconnect-over-xhr-polling
Quote:
"Solved the issue, it turns out it was a bug introduced in socket.io 0.9.5. If you have this issue just update BOTH your server and client-side code to socket.io > 0.9.9 and set the socket.io client-side options sync disconnect on unload to true and you're all set.
Options are set this way:
var socket = io.connect('http://yourdomain.com', {'sync disconnect on unload' : true});
"