how do i make my own P2P software? [closed]

我与影子孤独终老i 提交于 2019-12-02 17:12:50
thecoshman

P2P or Peer-to-Peer is a very hard type of program to create, mostly because of its very structure. Most internet applications are Client-Server this is because a lot of headaches are solved just by having a fixed server you know you can connect to. At the end of the day, that's more or less all Napster did, it just indexed files and said who is currently hosting them.

The other problem with creating P2P software, is that developing it on your own, you will have very few peers to test with, even if you do create a bunch of virtual computers. You will find it hard to test it scaled to 00's of users.

First steps though, you will need to learn to program in a suitable language, something like C++ or C# maybe just make it as a console application to learn the technology.

Next, learn how to work with files. Not much use if you can't save stuff is it.

Networking next. Start with a client-server set up just to get to grips with transferring files. Make a server app that gives the files and a client app that downloads it. Then start to scale it to one server giving files to lots of clients.

Final step is to merge the client and server so that as the peer downloads more of the file, it can start to be a server and let other clients download from it.

If you want, now you can think about a GUI.

Peer-to-peer sharing the way Napster worked only makes sense when you have lots of people sharing files. It's a bit of a chicken-and-egg problem, but it all comes down to this: no-one uses a network no-one uses. It's the same with social networks et al.

That being said, Qt4 does include a Network module which supports UDP and TCP, the basis for communicating over the Internet. There is documentation and example code available here.

As for your last question: I think the future for P2P is full of pain and suffering. Big Content is after the most-used 'feature' of p2p networking: sharing music and movies. Your opinion may be different.

I found the following link - http://en.wikibooks.org/w/index.php?title=The_World_of_Peer-to-Peer_(P2P)/Building_a_P2P_System

Its not yet complete but shall give you an idea of what to consider while designing or creating your own P2P network.

If I were you I would download the source code for very popular P2P programs like Frostwire. There is a pile of sourcecode up on sourceforge. Nothing better than seeing how everything fits together in a fully running project that's testable right away. Fully functioning code is great to learn off of.

http://sourceforge.net/projects/frostwire/

http://shareaza.sourceforge.net/

Once you see the daunting task ahead of you... you may not want to do it anymore. I only did a quick search for the source code for a couple of the more popular ones but Frostwire is probably the most used after Limewire. I have removed it off thousands of customer machines when I warn them about P2P (their kids are not downloading Linux ISO's) :)

Oooo... i just noticed the date on this. Well, I already typed this out and if you ever did start working on the project I'm sure you're STILL working on it :)

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!