I am using HttpWebRequest
in my application which is checking some URI\'s in multiple threads. I am getting multiple types of time out exceptions.
The operation has timed out occurs when a specified time is defined and server is not able to respond back in that particular time (occurs inside the remote server)
while
504 errors in the HTTP cycle (occurs in communication between client and server) Any client (e.g. your Web browser or our CheckUpDown robot) goes through the following cycle when it communicates with the Web server:
Obtain an IP address from the IP name of the site (the site URL without the leading 'http://'). This lookup (conversion of IP name to IP address) is provided by domain name servers (DNSs). Open an IP socket connection to that IP address. Write an HTTP data stream through that socket. Receive an HTTP data stream back from the Web server in response. This data stream contains status codes whose values are determined by the HTTP protocol. Parse this data stream for status codes and other useful information. This error occurs in the final step above when the client receives an HTTP status code that it recognises as '504'. (Last updated: March 2012).
Fixing 504 errors - general
This problem is entirely due to slow IP communication between back-end computers, possibly including the Web server. Only the people who set up the network at the site which hosts the Web server can fix this problem.