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?
Tom234
source
share