I need to write this end proint programatically in c# , this is for a chat application .
app.config part
<system.serviceModel>
<client>
<endpoint name="ChatEndPoint" address="net.p2p://chatMesh/ChatServer" binding="netPeerTcpBinding" bindingConfiguration="PeerTcpConfig" contract="Test.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>
C#
part
InstanceContext context = new InstanceContext(
new Home(txtUserName.Text.Trim()));
factory =
new DuplexChannelFactory<IChatChannel>(context, "ChatEndPoint");
channel = factory.CreateChannel();
This is working fine for me. However, I need to change the end point address dynamically. Looking for valuable support.