I believe I understand the practical differences between HttpWebRequest.Timeout
and HttpWebRequest.ReadWriteTimeout
. However, I\'m seeking further<
I believe you got the first part of your answer from @Donal Lafferty. Here's a quick summary anyway.
HttpWebRequest.Timeout - The time before which the server has to accept the client's request. Note that this doesn't include the DNS resolution time, which is managed by the ServicePointManager.
HttpWebRequest.ReadWriteTimeout - The time before which the client has to receive the entire body of the response from the server. Note that this timeout starts only after the server accepts the request.
The answer to your second question is two-folded.
1. Synchronous request:
The TCP connections are closed on timeout, everybody's happy.
2. Asynchronous request:
These timeouts have absolutely no effect. If you do not have an appropriate mechanism for handing the time-outs, the TCP connections will stay open.
That's precisely the reason why you Abort the request by registering a timeout on the AsyncWaitHandle, as shown in the example here:
http://msdn.microsoft.com/library/21k58ta7.aspx