Search code examples
cbittorrenttransfer

Simple file transfer


I want to create an application in C that allows two users to share a file. I'll call the person sending the file the server and the receiver the client. There are a few requirements:

  • The users need no identification, no "login". You could say they are unknown for my application.
  • The server selects a file for transfer and gets returned a simple ~10 character ID string/hash that the client can use to retrieve the file.
  • The same application is used for both serving and receiving.
  • My application must not need dedicated software running on a remote server, unless it's freely available (e.g. bittorrent trackers).

Now this sounds a lot like bittorrent and I am seriously thinking of doing this through bittorrent. I'm not sure how I would do this. Are there any good libraries for torrent creation / seeding / downloading?

Please answer this question by either:

  • Posing a viable alternative for bittorrent / other ideas.
  • Posting good libraries / snippets / implementations of the bittorrent protocol in C.

Solution

  • And an other solution, send the file through an IRC server (like Freenode). I came up with this solution after I had trouble with opening ports with bittorrent.