> But my simple and plain question is: In the call to *WSARecv* (inside > *uv_process_tcp_read_req* in *src\win\tcp.c*) size 65536 has been > specified. > Now, if I am developing a TCP server using libuv, what does this size mean > to me? >
As far as I'm aware size 65536 isn't passed to WSARecv. It's just the suggested allocation size that's passed to uv_alloc_cb(). This number was chosen because empirical evidence suggested that it guarantees optimal performance under high-throughput scenarios (e.g. receiving smaller chunks decreases throughput, and receiving larger chunks doesn't increase throughput significantly). But it is up to you to decide how much memory uv_alloc_cb() actually allocates. > 1. Can my clients write buffer of size 65535 at a time, for maximum > throughput? > Your clients can write buffers of any size. My suggestion would be to write all available data there is to write as a single chunk. The server will call alloc_cb() and read_cb() multiple times if necessary. 2. If not, how much maximum size can my clients write (without having data > loss) to wire, at a time ? > TCP is a reliable protocol; there should be no data loss. You can write chunks of any size op to 2gb or so. Of course if write data in very large chunks they take up space in memory until the write has been completed. -- 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 http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
