Click here to Skip to main content
15,890,355 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello folks,

I am not quite sure, if i can have an answer to this question but it will be nice to know some suggestions about it.

I have a windows service. It was working perfectly fine for a week but it seems that it stopped working on Wednesday. When I checked the service status it is appearing as running and startup type is automatic. The service has a interval of 2 hours. So in every 2 hours it makes a somewhere around 2000 web requests to gather some data from a web page. In my logger sometimes I got an error; "The remote server returned an error: (404) Not Found." I think this is because the Httpwebrequest is timed out and couldnt get a responce thats why it logs it as a error but as I said that didnt affect the service's working it kept working until Wednesday. So do you guys have something to come up with what I can check?

Thanks.
Posted
Comments
Chris Meech 4-Feb-11 14:42pm    
Where is the web page you are making the request? Is it a domain that you control? If not, perhaps someone has now restricted your ability to request the page?
Orcun Iyigun 4-Feb-11 15:16pm    
No it is not a domain that I control. The site that I make the requests accepts maximum 2000 calls per hour because of that not to make more than 2000 calls in an hour after each call I use thread.sleep for 3 sec to make another call. this way I end up making 2000 calls in some where around 1 hour 40 mins. I dont know if they restricted me or not.
JOAT-MON 4-Feb-11 15:32pm    
The error seems to indicate the absence of the requested location rather than the timeout of the request. Have you checked to see if the location you are requesting has been changed(i.e. moved, renamed, etc.)? Can you access the location through your browser as opposed to your service?
Orcun Iyigun 4-Feb-11 17:21pm    
Sometimes the page that I requested doesnt have the data I want so then I end up having an error as well but I avoid the program crashing by using try{} catch{} there maybe I am missing an event that might happen and cuz of that it crashes :(

1 solution

Make sure your service startup type settings are automatic so that in case your system reboots the service restarts automatically.
 
Share this answer
 
Comments
Orcun Iyigun 4-Feb-11 12:51pm    
well they are already automatic I think that is not the issue. Do you think something in the service cause the system to run out of memory?

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

  Print Answers RSS


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