我爱我老婆

异步模型中HttpWebRequest的Timeout

要控制HttpWebRequest在10秒内timeout, 设置两个属性即可,Timeout, ReadWriteTime

但在异步模型中,.net framework却没有帮我们实现timeout.

http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetresponse.aspx

如链接中所讲,In the case of asynchronous requests, it is the responsibility of the client application to implement its own time-out mechanism.

 

posted @ 2012-02-21 18:02  DataFlow  阅读(2498)  评论(0编辑  收藏  举报