Socket timeout can be overridden by the OS, which is about 21 seconds for windows by default. this does not have to do with HTTP as it is valid for any TCP connection. if you want to keep the connection alive for as long as possible, you'd better write a small packet into the stream every few seconds (5 seconds or so). If the client and server are both in windows, you would most probably have your connection closed after just 20 seconds. unless there is traffic going through the TCP connection, byte by byte. if it takes longer than the timeout set in HttpClient.Timeout Property for a full HTTP packet to be sent/received, the connection will be closed.
to sum up, the timeout for the underlying TCP socket and an HTTP client behave differently and to keep a connection alive for as long as possible (HTTP Long polling), you will have to write small bytes on the HTTP stream (from the server) every few seconds (5-10)