PNRP 是否可以在没有 Internet 连接的 LAN 上工作?

发布于 2024-08-19 17:34:32 字数 1095 浏览 4 评论 0原文

因此,我试图总体上理解 WCF,以及这个 MSDN 聊天特别是客户样本。我已经使用下面的配置进行了测试,它似乎工作正常。但是,如果互联网连接丢失(或不存在)会发生什么?同行的人还能找到彼此吗? (根据这个问题,我将询问“云的路由信息​​,以及它协作回答“。在这种情况下,“云”是否仅限于我的局域网?)

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

提前感谢您的帮助!

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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

罪歌 2024-08-26 17:34:32

他们在本地使用 SSDP 来查找同一子网上的对等点。这将使同伴即使在没有互联网连接的情况下也能找到彼此。

或者,您可以实现自己的“对等解析器”,它将充当注册服务器。如果您需要其中的示例,请发表评论,我将挖掘我的示例代码。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文