简体   繁体   中英

WCF Timeout - WSDualHttpBinding, How to set OperationTimeout

I'm creating a WSDualHttpBinding (from code), setting the following timeout values:

 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.

One client connects fine, the others log the following error :

"The open operation did not complete within the allotted timeout of 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.

But I've set the value > 1 minute. Whatever value I set, the Timeout is ALWAYS reported as 00:01:00!!

I don't understand.

I've read and read about this and the OperationTimeout property. But I cannot find anyway of setting it on a 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

Now all is well in the world - and faster.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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