Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
stream: add uv_cork() and uv_uncork() #743
Proposal: add two new API functions, uv_cork() and uv_uncork().
The first one stops libuv from trying to write out pending write reqs, the second one tells libuv it's okay again to write.
Purpose: to make it possible for the libuv user to signal libuv that he'll be making several calls to uv_write() and that libuv should try to batch those into a single writev() call.
Without cork/uncork, buf1 would likely be written out immediately and buf2 probably ends up in a separate TCP packet, meaning an extra round trip (=higher latency).