English 中文(简体)
C# Web Reference Call Timeout
原标题:C# Web Reference Call Timeout

我正在通过网络参考向外部服务发出呼吁。 计生机是动态的,因此,我把他们说出来,所有东西都奏效。 有时,一些计生方案获得了胜利,我正在等待时间。 问题是每次拨打的时间大约为30秒。 我试图将 w上的时间财产改为5秒,但似乎没有改变。 请允许我帮助我这样做吗?

问题回答

您可以以较短的时间(如1,000米)进行国家空间研究中心的考察:

http://www.chapleau.info/cs/blogs/fchapleau/archive/ 2008/09/09/reverse-dns-lookup-with-timeout-in-c.aspx

然后(如果发现有IP地址),使用IP地址(避免在你无法控制时间外面的国家安全局的监视),使用时间序列(如4 000 ms(或更佳:5000ms-(国家安全局的监视时间))实现总共5 000 ms。

Here is the answer I was looking for: Adjusting HttpWebRequest Connection Timeout in C#

****

可查阅<代码>的MSDN文件。 HttpWebRequest。 时间表 财产:

A Domain Name System (DNS) query may take up to 15 seconds to return or time out. If your request contains a host name that requires resolution and you set Timeout to a value less than 15 seconds, it may take 15 seconds or more before a WebException is thrown to indicate a timeout on your request.

你们说,你们改变了“ w子上的时间财产”到5秒。 如果你重新改变服务器上的停机,那么当客户能够连接时,这不会帮助你。

您使用“网络参考”,因此,我假定你有一个客户类别,来自<条码>System.Web.services. Protocols.SoapHttpClient Protocol。 这一类别来自<代码>System.Web.services. Protocols.WebClient Protocol,该文本具有时遗财产。 在发出呼吁之前,对你的客户改变这种财产,看看你是否取得更好的结果。

如果你在创建代理对象之前登出IP地址,并在此打电话到网络服务,则会有所助益。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签