WCF 超时 - 如何设置以及在何处设置?
我有关于超时的问题
问题 1:在哪里设置超时值(在服务器/服务端或客户端)?
问题 2:
根据定义,
openTimeout 顾名思义,是您在打开与 WCF 服务的连接时愿意等待的时间。同样,closeTimeout 是关闭连接(处置客户端代理)时抛出异常之前等待的时间量。
在这种情况下,如果我将打开和关闭超时设置为 10 分钟 (00:10:00),将会发生什么
A。当客户端尝试打开连接时?服务会慢慢打开连接吗?
B。当客户端在调用方法后尝试关闭连接时?是不是10分钟后就关门了?
请帮助我理解。
谢谢
I have a question about timeouts
Question 1: Where to set timeout values (on server/service side or client side)?
Question 2:
By definition,
The openTimeout as the name implies is the amount of time you're willing to wait when you open the connection to your WCF service. Similarly, the closeTimeout is the amount of time when you close the connection (dispose the client proxy) that you'll wait before an exception is thrown.
In this case if I set the open and close time out to 10 minutes (00:10:00) what will happen
A. when client tries to openconnection? Is service will slowly opens connection?
B. when client tries to closeconnection after making calll to a method? Is this going to close only after 10 min's?
Please help me to understand.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
超时是在建立通信的一侧设置的。在您的示例中,我相信这将是客户端。
A) 客户端在抛出错误之前将有 10 分钟的时间尝试建立连接。
B) 客户端在抛出错误之前将有 10 分钟的时间来关闭已建立的连接。
The timeout is set on the side which is establishing the communication. In your example I believe it would be the client side.
A) The client will have 10 minutes to attempt to establish a connection before it throws an error.
B) The client will have 10 minutes to close the established connection before it throws an error.