I have a named pipe wcf service that I need to programmatically set the ChannelInitializationTimeout property for. I am currently not using any configuration files. Here is my current client code:
ChannelFactory<IStringReverser> pipeFactory = new ChannelFactory<IStringReverser>(
new NetNamedPipeBinding(),
new EndpointAddress(
"net.pipe://localhost/PipeReverse"));
IStringReverser pipeProxy = pipeFactory.CreateChannel();
Following is my server code:
using (System.ServiceModel.ServiceHost host = new System.ServiceModel.ServiceHost(typeof(StringReverser),
new Uri[]{new Uri("net.pipe://localhost")}))
{
host.AddServiceEndpoint(typeof(IStringReverser),
new NetNamedPipeBinding(),
"PipeReverse");
host.Open();
Console.WriteLine("Service is available. " +
"Press <ENTER> to exit.");
Console.ReadLine();
host.Close();
}
The service is functioning correctly, but I am trying to figure out how to programmatically change the ChannelInitializationTimeout property as part of another issue I am trying to solve.
Any ideas on how to do this strictly in code? Thanks in advance.