I have a big problem with WebClient class on Windows Server 2008. I have small code that downloads data from web using WebClient.DownloadFile/DownloadData method. Everything works ok on Windows 2003 and Windows 7, but not on Windows Server 2008. On 2008 I get a very low speed (about 5kb/s where normaly I have about 1mb/s).
I did some research and checking: - problem only exists on couple of servers (not every one, one of it is newconnect.pl -> example file http://newconnect.pl/index.php?page=get_ebi_file&id=6023), - I checked a couple of servers with 2008 - diffrent machines, different network connections - problem existed at each one. - I tried the trick with setting proxy to null or empty - didnt help - I used wireshark to check what is wrong - I didnt notice anything weird, just lower speed. - if I create a virtual machine with windows 2003 at windows 2008 and install downloader at win2k3 it works ok.
Thanks for help.
Code:
class Program
{
static void Main(string[] args)
{
string file1 = "http://newconnect.pl/index.php?page=get_espi_file&file=zal_7161967.pdf";
string file2 = "http://newconnect.pl/index.php?page=get_espi_file&file=zal_7163706.pdf";
WebClient wc = new WebClient();
wc.Proxy = null;
Console.WriteLine(DateTime.Now.ToString());
wc.DownloadData(file1);
Console.WriteLine(DateTime.Now.ToString());
wc.DownloadData(file2);
Console.WriteLine(DateTime.Now.ToString());
Console.Read();
}
}
}