<system.servicemodel> <client> <endpoint name="ChatEndPoint" address="net.p2p://chatMesh/ChatServer" binding="netPeerTcpBinding" bindingconfiguration="PeerTcpConfig" contract="Clinical_Vista.IChatService"></endpoint> </client> <bindings> <netpeertcpbinding> <binding name="PeerTcpConfig" port="0"> <security mode="None"></security> <resolver mode="Custom"> <custom address="net.tcp://192.168.0.147:22222/ChatServer" binding="netTcpBinding" bindingconfiguration="TcpConfig"></custom> </resolver> </binding> <!--<binding name="BindingDefault" port="0"> <security mode="None"></security> <resolver mode="Auto"></resolver> </binding>--> </netpeertcpbinding> <nettcpbinding> <binding name="TcpConfig"> <security mode="None"></security> </binding> </nettcpbinding> </bindings> </system.servicemodel>
InstanceContext context = new InstanceContext( new Home(txtUserName.Text.Trim())); factory = new DuplexChannelFactory<ichatchannel>(context, "ChatEndPoint"); channel = factory.CreateChannel();
EndpointAddress endpointAddress = new EndpointAddress("net.p2p://chatMesh/ChatServer"); ContractDescription contract = new ContractDescription("IChatService", "Clinical_Vista"); System.ServiceModel.Channels.Binding binding = new NetPeerTcpBinding(); binding.Name = "PeerTcpConfig"; ServiceEndpoint se = new ServiceEndpoint(contract, binding, endpointAddress); InstanceContext context = new InstanceContext( new Home(userName)); factory = new DuplexChannelFactory<ichatchannel>(context, se); channel = factory.CreateChannel();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)