因此,我试图一般地理解WCF,这 MSDN聊天客户端样本 尤其是。我一直在下面的配置测试,似乎正常工作。但是,如果丢失了Internet连接(或不存在),会发生什么?同行仍然可以互相找到吗? (根据 这个问题, ,我将询问“路由信息的云,并协作答案”。在这种情况下,“云”会局限于我的局域网吗?)

<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>

在此先感谢您的任何帮助!

有帮助吗?

解决方案

他们在本地使用SSDP查找在同一子网上的同行。这将使同行即使没有Internet连接也可以互相找到。

另外,您可以实现自己的“同行解析器”,该“同行解析器”将充当注册服务器。如果您需要该示例,请发表评论,我将挖掘我的示例代码。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top