nlf/riakpbc — pull request #50 by oleksiyk (2014-02-06 14:09:48+00:00)
Title: Fix buffer offset error in ConnectionManager._receive + some refactoring

This PR will:

1. Fix possible buffer offset error at https://github.com/nlf/riakpbc/blob/master/lib/connection-manager.js#L110 (4 bytes will be read even if there is only 1 byte available at the end of the buffer). The error was quite rare but I was able to replicate it on large amounts of data.
2. Refactor `_receive()` to use a single read buffer which results in some performance gains
3. Refactor `send()` to not call `connect()` on each invocation