-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible Socket.SendFileAsync issue with files >2GiB. #41906
Comments
Tagging subscribers to this area: @dotnet/ncl |
On Windows, TransmitFile is limited to 2GB. See https://docs.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-transmitfile We may not need the same limitation for Linux, though. |
Would it make sense to check file size and fall-back to some internal implementation if file is too big? That would give us consistency while preserving perf benefits when possible... |
Possibly, yeah. At the very least we should give a good exception here instead of just casting and losing the actual file length... |
actually
it seems like the correct way is to make multiple calls - and I'm not sure we do. |
I separated this out into #42534. |
Within our Unix code, we are casting
FileStream.Length
to anint
here:runtime/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs
Lines 1811 to 1812 in 84c1f62
This would fail for any files greater than 2GiB in length.
The text was updated successfully, but these errors were encountered: