Ah, okay. Nice to know we are doing basically the same optimization then. I should probably use uv_tcp_t then.
Den onsdag 23 mars 2016 kl. 12:54:15 UTC+1 skrev Ben Noordhuis: > > On Wed, Mar 23, 2016 at 12:33 PM, Alex Hultman <[email protected] > <javascript:>> wrote: > > Hi. > > > > I've briefly looked at the code but I didn't directly find what I was > > looking for. > > > > I'm wondering if uv_tcp_t tries to write to the socket before it decides > to > > queue the data for next writable event? I do this in my use of uv_poll_t > and > > it is very fast because I do not need to copy the data and queue it if > it > > turns out the socket was writable at the very function call. > > > > So if I have a char *data I can directly write it to the kernel buffer > and > > skip the queueing. Is this empoyed in uv_tcp_t, or do you have any > > opposition to this technique? > > uv_write() tries to write out the data immediately but will still > queue the 'write complete' callback. > > uv_try_write() is like uv_write() but it skips the callback when it > can, details in the documentation. Does that answer your question? > -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
