PNRP 是否可以在没有 Internet 连接的 LAN 上工作?
因此,我试图总体上理解 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
他们在本地使用 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.