I am trying to find my servers with the help of WCF Discovery protocol.
Everything is nice when I specify explicit address for server, for example: net.tcp://192.168.36.18:8888.
But when I specify net.tcp://0.0.0.0:8888
address on the server to listen all interfaces I receive net.tcp://0.0.0.0:8888 on the client. Certainly, I can't use this address to connect to the server.
Physically responce for wcf discovery request is coming from real servers addresses: 192.168.36.100, 192.168.36.239
and 192.168.36.61
. I can see it by Wireshark
. But I can't get this adresses from FindResponce class
.
Is there a way to get physical address if server was configured to listen all interfaces by WCF discovery?
Code on the client:
var discoveryClient = new DiscoveryClient(new UdpDiscoveryEndpoint());
var findResponce = discoveryClient.Find(new FindCriteria(typeof(IRadioService)));
discoveryClient.Close();
Code on the server:
var serviceHost = new ServiceHost(new RadioServer());
serviceHost.Open();
Config on the server:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="RadioServer">
<serviceDiscovery />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="RadioServer" name="Server.RadioServer">
<endpoint address="RS" binding="netTcpBinding" contract="Common.IRadioService" />
<endpoint name="udpDiscovery" kind="udpDiscoveryEndpoint" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://0.0.0.0:8888/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>