Click here to Skip to main content
15,910,358 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am facing problem during executing my window service...service Timeouts after 15-20 min.I am calling application URL from service and application URL has heavy data on it to process

What I have tried:

if (mode == "DAILY")
{
//Get the Scheduled Time from AppSettings.
scheduledTime = DateTime.Parse(System.Configuration.ConfigurationManager.AppSettings["ScheduledTime"]);
if (DateTime.Now > scheduledTime)
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create("http://........");
req.Timeout = 1000000;
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();

//If Scheduled Time is passed set Schedule for the next day.
scheduledTime = scheduledTime.AddDays(1);
}
}
Posted
Comments
Richard Deeming 11-Aug-16 9:42am    
Hardly surprising, since you've specified a timeout of 16 minutes 40 seconds on your HttpWebRequest!
WebRequest.Timeout Property[^]: Gets or sets the length of time, in milliseconds, before the request times out.

If you want a longer timeout, then increase the timeout. What's the problem?

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