Hello All,
What do you guys think about the performance of WSASend with multiple buffers? Specifically, I want to know if it'll be computationally cheaper to post an array of buffers, or to copy the multiple buffers into one buffer and just send from one array. I imagine that WSASend will just do this copy anyways...

But then I've read you can use setsockopt to set SNDBUF to 0... would this mean that WSASend would skip the copy and just send the data directly from the buffers in memory?

The reason I ask is cause I want to write a server that many users can search and access a database. When the client sends a search, the server sends the matching database entries (each being around 128 bytes or less).

Thanks for any input
--Chorus
Posted on 2002-10-13 14:37:02 by chorus
AFAIK all winsock data gets buffered anyway, so just do what's easiest :)

Someone please correct me if I'm wrong...
Posted on 2002-10-14 09:04:01 by Qweerdy
Winsock manages the package size so the format in which you feed data to winsock does not affect the packets directly. One call with multiple buffers might be a bit faster than multiple calls with a small buffer, winsock will know you are sending multiple data parts instead of one so it might optimize the packets for it (if you use one call it can't tell whether it will be the only one for some time, or more are comming). I don't know for sure if winsock does this but it seems logical...

Thomas
Posted on 2002-10-14 14:04:46 by Thomas