I believe you do not need a custom timeout handling implementation for this. Try out setting webRequest.Timeout
property to 60000.
To specify the amount of time to wait before a read or write operation times out, use the ReadWriteTimeout property.
Important
The Timeout property must be set before the GetRequestStream or
GetResponse method is called. Changing the Timeout property after
calling the GetRequestStream or GetResponse method has no effect
EDIT:
If you are looking for a custom timeout handling you still can leverage built in Timeout
as well. So just handle a WebException
and then analyze exeption Status property whcih could indicate what caused timeout. There are different status codes could be so just emulate it on local machine by disconnecting a network (simulate network connection lost) and see what is the status, then you can add some code to handle this scenario and launch custom timer for 60seconds).
I believe you need to handle following statuses:
- ConnectFailure: The remote service point could not be contacted at the transport level.
- Timeout: No response was received during the time-out period for a request.
See all available statuses: WebExceptionStatus Enumeration
Please let me know if you need more details or something is not clear.