LearnBoost/engine.io — pull request #13 by ruxkor (2012-03-02 17:05:03+00:00)
Title: add on('error') handler for websocket transport

if an error is happening on the `websocket.io` socket, this socket emits an error. since the current engine.io socket is not handling this error, the whole process crashes.

a simple binding seems to resolve this issue.

*example of a log output
```
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: read ETIMEDOUT
at errnoException (net.js:642:11)
at TCP.onread (net.js:375:20)
----------------------------------------
at EventEmitter.on
at WebSocket.Socket (/.../node_modules/engine.ns.io/node_modules/engine.io/node_modules/websocket.io/lib/socket.js:30:6)
at new WebSocket (/.../node_modules/engine.ns.io/node_modules/engine.io/node_modules/websocket.io/lib/protocols/hybi-07-12.js:61:10)
at Server.createClient (/.../node_modules/engine.ns.io/node_modules/engine.io/node_modules/websocket.io/lib/server.js:88:10)
at Server.handleUpgrade (/.../node_modules/engine.ns.io/node_modules/engine.io/node_modules/websocket.io/lib/server.js:60:21)
at Server.handleUpgrade (/.../node_modules/engine.ns.io/node_modules/engine.io/lib/server.js:208:11)
at Server. (/.../node_modules/engine.ns.io/node_modules/engine.io/lib/engine.io.js:126:16)
at Server.emit (events.js:88:20)
----------------------------------------
at EventEmitter.on
at Object.attach (/.../node_modules/engine.ns.io/node_modules/engine.io/lib/engine.io.js:124:12)
at Object.listen (/.../node_modules/engine.ns.io/node_modules/engine.io/lib/engine.io.js:80:24)
at Object. (/.../server.coffee:269:17)
at Object. (/.../server.coffee:278:4)
at Module._compile (module.js:441:26)
at Object.run (/.../node_modules/coffee-script/lib/coffee-script/coffee-script.js:68:25)
at /.../node_modules/coffee-script/lib/coffee-script/command.js:135:29
at /.../node_modules/coffee-script/lib/coffee-script/command.js:110:18