public static void ContectServer() { if (Server == null) { InstanceContext instanceContext = new InstanceContext(new WcfServerCallback()); DuplexChannelFactory <IWcfServer> channelFactory = new DuplexChannelFactory <IWcfServer>(instanceContext, "ServiceLibrary.WcfServer"); Server = channelFactory.CreateChannel(); } }
static WcfClient() { TheWcfServer = ChannelFactory<IWcfServer>.CreateChannel(new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/" + ChannelName + "/" + ObjectName + "/")); }