WCF: which timeout property to use?

I have code similar to

            NetTcpBinding binding = new NetTcpBinding(SecurityMode.Transport);
            binding.Security.Message.ClientCredentialType = MessageCredentialType.Windows;
            binding.CloseTimeout = new TimeSpan(0, 0, 1);
            binding.OpenTimeout = new TimeSpan(0, 0, 1);
            binding.SendTimeout = new TimeSpan(0, 0, 1);
            binding.ReceiveTimeout = new TimeSpan(0, 0, 1);

            EndpointAddress endPoint = new EndpointAddress(new Uri(clientPath));

            DuplexChannelFactory<Iservice> channel = new DuplexChannelFactory<Iservice>(new ClientCallBack(clientName), binding, endPoint);
            channel.Ping() 

When the endpoint does not exist, it still waits 20 seconds before throwing an EndpointNotFoundException.

The strange thing is that when I changed SendTimeout, the exception message changed from Connection attempt lasted from 00:00:20 to .... 01, but it took 20 seconds to throw an exception!

How can I change this timeout?

+3
source share
2 answers

, WCF, , , TCP/IP OS, , , DNS, IP, TCP/IP - 20 , - url IE, , , , . , - TCP/IP, WCF.

0
0

Source: https://habr.com/ru/post/1718355/


All Articles