tags:

views:

187

answers:

2

So, I'm trying to make sense of WCF in general, and this MSDN chat client sample in particular. I have been testing with the configuration below, and it seems to be working fine. However, what will happen if the Internet connection is lost (or nonexistent)? Will the peers still be able to find each other? (According to this question, I will be asking "the cloud for routing information, and it collaboratively answers". Would the "cloud" in this case be confined to my LAN?)

<client>
    <!-- chat instance participating in the mesh -->
    <endpoint name="ChatEndpoint"
            address="net.p2p://chatMesh/ServiceModelSamples/Chat"
            binding="netPeerTcpBinding"
            bindingConfiguration="BindingDefault"
            contract="Microsoft.ServiceModel.Samples.IChat">
    </endpoint>
 </client>


<bindings>
  <netPeerTcpBinding>
    <!-- Refer to Peer channel security samples on how to configure netPeerTcpBinding for security --> 
      <binding name="BindingDefault" port="0">
      <security mode="None"/>
      <resolver mode="Auto"/>
    </binding>
  </netPeerTcpBinding>
</bindings>

Thanks in advance for any help!

+1  A: 

Locally they use SSDP to find peers that are on the same subnet. This will allow peers to find each other even with no internet connection.

Alternatively, you can implement your own "Peer Resolver" that will act as a registration server. If you need a sample of that please post a comment and I'll dig up my sample code.

Matthew Steeples
Thanks, that's the answer I was looking for. I'm trying to avoid the custom peer resolver route, so no need for samples on that one :)
Eyvind
A: 

I was looking for this answer too. Thanks Matthew & Eyvind. To extend this further, is there any way, programmatically, to tell PNRP to never use the internet?