简体   繁体   English

WCF超时-WSDualHttpBinding,如何设置OperationTimeout

[英]WCF Timeout - WSDualHttpBinding, How to set OperationTimeout

I'm creating a WSDualHttpBinding (from code), setting the following timeout values: 我正在创建WSDualHttpBinding(从代码),设置以下超时值:

 peerBinding.CloseTimeout = TimeSpan.FromSeconds(ServiceConnector_Constants.CLOSETIMEOUT);
            peerBinding.OpenTimeout = TimeSpan.FromSeconds(ServiceConnector_Constants.OPENTIMEOUT);
            peerBinding.SendTimeout = TimeSpan.FromSeconds(ServiceConnector_Constants.SENDTIMEOUT);

These constant (for exasperation purposes) values are 600 seconds. 这些常数(出于激怒目的)值为600秒。

One client connects fine, the others log the following error : 一个客户端连接正常,其他客户端记录以下错误:

"The open operation did not complete within the allotted timeout of 00:01:00" “打开操作未在指定的00:01:00超时内完成”

This is at the following line of code : 这是下面的代码行:

                            _clientFactory.Open();

                        //Log(String.Format("Create Client IN 6"));
                        LogMessage("Creating client...");
                        _serviceConnection = _clientFactory.CreateChannel();
                        LogMessage("Client Created...");

The last logged line is "Creating Client". 最后记录的行是“正在创建客户端”。 It appears that the CreateChannel is causing the problem. 看来是CreateChannel引起了问题。

But I've set the value > 1 minute. 但我将值设置为> 1分钟。 Whatever value I set, the Timeout is ALWAYS reported as 00:01:00!! 无论我设置什么值,超时总是报告为00:01:00!

I don't understand. 我不明白

I've read and read about this and the OperationTimeout property. 我已经阅读并阅读了有关此内容和OperationTimeout属性。 But I cannot find anyway of setting it on a WSDualHttpBinding. 但是我还是找不到在WSDualHttpBinding上设置它的方法。

Can anyone please help. 谁能帮忙。

Thanks 谢谢

The solution is NOT to use wsDualHTTPBinding as advised in this excellent SO solution : why NOT to use wsDualHttpBinding in client/server 解决方案是不按照此出色的SO解决方案中的建议使用wsDualHTTPBinding: 为什么不在客户端/服务器中使用wsDualHttpBinding

Now all is well in the world - and faster. 现在世界上一切都很好-并且速度更快。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM