-
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
Socket.BeginSendFile throws SocketException "The parameter is incorrect" when sending large files #41834
Comments
Tagging subscribers to this area: @dotnet/ncl |
Can you please confirm that this happens on .NET Core 3.x or with a .NET 5 preview? |
It's happening for me on ASP.Net Core 5 |
Yeah, I've found the same thing, according to my research, it's using TransmitFile underneath, which has the 2GB limitation. One workaround I've found is to use the DotNetZip NuGet package to compress and split the big file into smaller ones before sending. This package can do the splitZip with a custom maxOutputSegmentSize: int segmentsCreated;
using (ZipFile zip = new ZipFile())
{
zip.AddDirectory(filePath);
zip.MaxOutputSegmentSize = int.MaxValue;
zip.Save(zipPath);
segmentsCreated = zip.NumberOfSegmentsForMostRecentSave;
} |
closing as dup of #42534. |
This issue has been moved from a ticket on Developer Community.
Socket.BeginSendFile throws a socket exception System.Net.Sockets.SocketException: 'The parameter is incorrect'
when trying to send files more than 3.5 GB, however files less than 1.5 GB was sent without problems.
To reproduce the issue :
1. Create a TCP socket.
2. Connect the socket to the remote endpoint.
3. Send a 3.5 GB file using Socket.BeginSendFile(String, AsyncCallback, Object)
Tested on both 2004 and 1809 Windows 10 builds and same exception was thrown.
To help reproducing the issue the code can be found here.
Original Comments
Feedback Bot on 8/17/2020, 01:12 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)
The text was updated successfully, but these errors were encountered: