LearnBoost/socket.io-client — pull request #374 by SlNPacifist (2012-01-20 09:00:49+00:00)
Title: Xhr-based transports didn't close on "not handshaken" error and spammed server with "null".

At line https://github.com/LearnBoost/socket.io-client/blob/master/lib/socket.js#L221 xhr-based transport starts polling, but server responses with "not handshaken" error.
Socket doesn't handle disconnect as socket.connected flag is not set yet and transport is left open. While transport is open it sends "null" each time it receives data from server in order to keep connection to server. For example, xhr-polling does it in https://github.com/LearnBoost/socket.io-client/blob/master/lib/transports/xhr-polling.js#L71.
This patch closes transport if socket gets error with "reconnect" advice during connecting process.