On Mon, Oct 12, 2015 at 8:03 PM, Bruno Jesus 00cpxxx@gmail.com wrote:
... Hi all. What about reading SO_SNDBUF where it is available and 1024 where it is not. Because I think send() will fail if you try to write more than the kernel buffer size.
I found some more useful information on what TransmitFile it supposed to do (2^16 is a sane default): http://source.winehq.org/patches/data/115187
We could consider using the SO_SNDBUF size, but how we treat it would need to be platform dependent. On Linux you need to divide the value by 2 and on BSD it's the value it says it is - I'm not sure about other platforms. It might make sense to go to the trouble to do this, but I'm not sure it's worth worrying about. We could go back to 1024 (the minimum permitted value for the "real" SO_SNDBUF size), though, as AJ points out, that value is quite small. Since the "real" default on Linux systems is 2^16 (2*2^16 reported) or larger I think we just go with the 2^16 value from MSDN.
Best, Erich