Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
public class WebClientEx : WebClient
   {
 
       protected override WebRequest GetWebRequest(Uri address)
       {
 
           HttpWebRequest request = (HttpWebRequest)base.GetWebRequest(address);
 
           request.ReadWriteTimeout = 2147483647;
 
           request.Timeout = 2147483647;
 
           request.SendChunked = true;
 
           request.AllowWriteStreamBuffering = false;
           request.ContentType = "application/octet-stream";
           // request.exnc = Encoding.UTF8;

           return request;
 
       }
 
   }


WebClientEx wc = new WebClientEx();
 
                      wc.UploadFileAsync(new Uri(@"https://www.example.com/UploadFile.svc/UploadFile"), "POST", file);



I am overriding webclient class for file streaming. Will it cause any performance issue by overriding?
Posted
Comments
Richard Deeming 28-Oct-15 10:10am    
Measure the performance with your class; measure the performance with the built-in class; compare the two.

The performance will depend on how you're using it, and what URL you're loading. Only you can measure that!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900