LearnBoost/engine.io — pull request #147 by xixixao (2013-02-16 03:07:18+00:00)
Title: #73 Adopt Stream API

Implements #73

Points to discuss:

- data is raw utf-8 string, not a buffer, because socket.io doesn't support binary.

- how should timeout and "* error" be handled against the nodejs api?
+ **+** replace onClose calls by onEarlyClose which emits error and calls onClose
- **-** changes socket.io api, sorta (some stuff in dev examples)
* **_** I think we should only emit "end" on `server close`, `transport close`

Also:
emitting 'error' before 'close' makes tests fail
socket.io 'close' clashes with node api

should we support setEncoding method?
+ **+** yes, so that socket is pluggable
- **-** no, so people dont expect encodings we dont support (can we support
other encodings?)
* **_** unless we can support different encodings, I would not support it, or
throw an error when user tries to call it

we can't support pause and resume (surely?) - or do we just dummy pause?