I have a WCF service that uses the NetTcpBinding and is running within a Windows service. Remote clients connect to this service. So far, I have defined the endpoint to use "localhost".
If the host machine has multiple network adapters, will it receive messages on all adapters?
Would it be better to assign the machine's host name to the endpoint instead of "localhost"?
What are the advantages/disadvantages?
You can use System.Environment.MachineName
For example:
new EndpointAddress(new UriBuilder {Scheme = Uri.UriSchemeNetTcp, Port = port, Host = System.Environment.MachineName}.Uri);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With