0
votes

I'm trying to develop a C# to upload videos. I'm using httpwebrequest and the application works there are few threads to upload the videos but when I try to increase the threads some of the videos fail to upload and the thread gets this exception:

An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full

I don't know what the exact problem is but maybe it has to do with limited memory when the application tries to buffer multiple videos before uploading.

I simply want to upload multiple videos simultaneously... Any solutions?

1
Are you properly disposing the httpwebrequests by wrapping them in a using statement? - dtb

1 Answers

0
votes

Make sure to set the AllowWriteStreamBuffering property to false on the HttpWebRequest.

Also, did you consider using System.Net.Http's HttpClient api which has a better programming model?