如何在 C# 中实现 P2P?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1146637/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to implement P2P in C#?
提问by guaike
Recently, I would like to develop a simple chat program using c# and Winform,Main feature is chat and file transfer ,But i can't found example about implement p2p using dotnet,Who can help me?
最近想用c#和Winform开发一个简单的聊天程序,主要功能是聊天和文件传输,但是找不到用dotnet实现p2p的例子,谁能帮帮我?
回答by Remus Rusanu
Do you want to implement p2p functionality or a specific p2p protocol?
您要实现 p2p 功能还是特定的 p2p 协议?
For generic p2p functionality, or any kind of communication functionality, you should probably use WCF.
对于通用 p2p 功能或任何类型的通信功能,您可能应该使用 WCF。
For specific p2p protocols, like direct connect, BitTorrentand the like you need to decide first which protocol you want to use, and most likely there will be an already existing .Net library for it.
对于特定的 p2p 协议,例如直接连接、BitTorrent等,您需要首先决定要使用哪种协议,并且很可能已经存在一个适用于它的 .Net 库。