Slow Opening Initial Internet Connection in console application

A

abentov

Hi,

I have a console application which should read xml from the Internet at some
point. I've noticed that it takes plenty of time (between 10-15 sec) for
initially "setting" an Internet connection via the console application. The
same code works instantly in a asp.net web project.

The example below illustrates the problem: It takes 14 seconds for step 1 and
0,0 seconds for steps 2 and 3.
All files on server are really small (about 1 kb each - 10-15 lines)

using (System.Net.WebClient wc = new System.Net.WebClient())
{
//step1
wc.DownloadFile("http://somedomain/test1.xml",
@"C:\Test1.xml");

//step2
wc.DownloadFile("http://somedomain/test2.xml",
@"C:\Test2.xml");

//step3
wc.DownloadFile("http://somedomain/test3.xml",
@"C:\Test3.xml");
}

Thanks in advance for your help,
Albert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top