nodejitsu/nssocket — pull request #11 by kilianc (2012-07-06 03:35:51+00:00)
Title: added binary support

I completely rewrote the parser in order to be able to send Buffers as messages.
Now it is faster because we know each message how much is long and we don't have to try/catch every data event.

I hope the style is consistent with yours.

My only concern is about the node requirement that now is v0.7.x because of `Buffer.concat`.
If you want we can do it the old way.

Also even if I provided new test, would be cool to move from vows to mocha the whole suite, I can do it.

If you're going to merge this, I need to update doc's too.

__Ex__

```js

socket.send('image::large', fs.readFileSync('/my/awesome/path'))
```

P.S. my finally thought about this, is that we should be able to __pipe all the things__, so a 'start::data' event with a stream would be super awesome.

```js

// adding this event will disable internal buffering for binary messages.
socket.on('start::data', function (stream) {
stream.pipe(fileStream)
})
```