Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Gather output method for net.js module? #5151

Closed
changchang opened this Issue Mar 27, 2013 · 1 comment

Comments

Projects
None yet
2 participants

I have a list of Buffer data to send by network and I want to find a convenient interface to do that.

In libuv, the uv_write function can receive a list of uv_but_t as parameter to write data in batch. But I can not find the equivalent in the js layer (in net.js and StreamWrap class).

So I have to send the buffers individually in a loop or create a big buffer by concating all the buffers together before sending.

Is there any other good suggestion to do this job?

Owner

bnoordhuis commented Mar 27, 2013

No, those are the two options.

Concatenating everything in one big buffer gives the best performance right now (highest throughput and lowest latency) but that might change, see joyent/libuv#742.

@bnoordhuis bnoordhuis closed this Mar 27, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment