对于.NET 2.0可靠的HTTP库 [英] A reliable HTTP library for .Net 2.0

查看:110
本文介绍了对于.NET 2.0可靠的HTTP库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

NET的实现HTTP是...问题。除了符合一些问题与HTTP / 1.0,什么是窃听我现在是 HttpWebResponse.GetResponse()与ReadTimeout 超时设置为5000块约20秒钟失败(问题是,它应该在5秒后失败,但它实际上需要20秒)。

.Net's implementation of HTTP is ... problematic. Beyond some issues in compliance with HTTP/1.0, what's bugging me right now is that HttpWebResponse.GetResponse() with ReadTimeout and Timeout set to 5000 blocks for about 20 seconds before failing (the problem is it should fail after 5 seconds, but it actually takes 20 seconds).

我需要更好的协议一致性和超时控制库。你还知道其他?

I need a library with better protocol conformance and timeout control. Know any?

推荐答案

据<一href="http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/8e554674-8e4e-4e29-bb77-b9c2b287ed50"相对=nofollow>微软,有什么可以挂可能是DNS解析,这可能需要长达15秒。

According to Microsoft, what could be hanging is possibly the DNS resolution, which may take up to 15 seconds.

解决方案 - 做DNS解析你自己(Dns.BeginGetHostByName)

Solution - do the DNS resolving on your own (Dns.BeginGetHostByName).

这篇关于对于.NET 2.0可靠的HTTP库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆