WCF Service Endpoint

I am confused why something is working. I configure the wcf service as follows:

<services> <service name="ClientCommand" behaviorConfiguration="SomeServiceBehavior"> <endpoint contract="IClientCommand" binding="netTcpBinding" BindingConfiguration="TcpPort" address="net.tcp://localhost:1304" /> </service> </services> 

The configuration of BindingConfiguration and behaviorConfiguration is very simple, just setting up some timeouts.

In my exe, I run such a host.

 _serverHost = new ServiceHost(type); // implementing IClientCommand _serverHost.Open(); 

Everything is quite simple and works, I can call this service from another computer. However, after reading another problem (listening to tcp sockets), I get the impression that it should not work. How do I get attached to localhost, the service should not be accessible from outside the computer on which it runs?
I checked netstat on a PC and tied it to the IP address "0.0.0.0" instead of "127.0.0.1", explaining why it works from another computer.

But I do not understand why this comes from localhost to "0.0.0.0"?

+6
source share
1 answer

Net.tcp is not limited to communication on one machine, maybe you are thinking about net.pipe? As for 0.0.0.0: How is the host file determined on the machine on which the service is running? Here is a good article about WCF in general.

0
source

All Articles