Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Socket SendFile or BeginSendFile Is there a size limit #34540
There's no limit enforced by .NET. Any limitation here comes from the underlying OS. e.g. on Windows SendFile is just a thin wrapper for TransmitFile, and according to https://docs.microsoft.com/en-us/windows/desktop/api/mswsock/nf-mswsock-transmitfile, "The maximum number of bytes that can be transmitted using a single call to the TransmitFile function is 2,147,483,646, the maximum value for a 32-bit integer minus 1." It might be possible for SendFile to make multiple TransmitFile calls if it sees the file length is too large.
SendFile only invoke TransmitFile once