Created
August 11, 2010 23:55
-
-
Save aredridel/520037 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buffer = new Buffer(1024 * 1024); | |
buffer.readFrom(socketA); | |
buffer.writeTo(socketB); | |
... is this sys.pump, with a one megabyte buffer? | |
Make write throw an error when it would block (making sure people handle writes in the wouldblock case, not blocking nor throwing data away) | |
Make an enlargeable buffer for cases where you want the old growing-memory behavior of write() | |
And make a non-buffering case. | |
Instead of either not having a buffer, or disabling it in some cases ... why not let one have control of it? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment