我开始我的WCF服务是这样的:WCF启动的net.tcp服务通过互联网
host = new ServiceHost(typeof(Host), new Uri("net.tcp://127.0.0.1:40000"));
host.AddServiceEndpoint(typeof(IHost), new NetTcpBinding(), "");
host.Open();
和客户端应用程序连接到它:
IProxy proxy = new DuplexChannelFactory<IProxy>(callback, new NetTcpBinding(), new EndpointAddress("net.tcp://127.0.0.1:40000")).CreateChannel();
它工作正常。我可以连接到服务器并交换数据。问题是我如何启动这项服务(服务器),以便我的网络外部的计算机可以通过互联网连接到它?