How to write a simple Bittorrent application?

You should try libtorrent (rasterbar). http://libtorrent.org If you want to write your client in python, on linux, install it with: sudo apt-get install python-libtorrent A very simple example of python code to use it to download a torrent: import libtorrent as lt import time import sys ses = lt.session({‘listen_interfaces’: ‘0.0.0.0:6881’}) info = lt.torrent_info(sys.argv[1]) h = … Read more

Can someone explain what a wire-level protocol is?

I wouldn’t say that something uses a wire-level protocol or doesn’t – I’d talk about which wire-level protocol it uses. Basically, if something’s communicating with a remote machine (even conceptually) then there’s some data going across the network connection (the wire). The description of that data is the “wire-level protocol”. Even within that, you would … Read more

What is the best approach to handle large file uploads in a rails app?

I’ve dealt with this issue on several sites, using a few of the techniques you’ve illustrated above and a few that you haven’t. The good news is that it is actually pretty realistic to allow massive uploads. A lot of this depends on what you actually plan to do with the file after you have … Read more

Is it possible to build a torrent client using only HTML(5) and JavaScript?

No. It’s not. This is because the WebSocket specification falls outside of HTML5 and JavaScript 😉 That being said, opening up the question to “using features supported natively in [progressive/upcoming] browsers” then… …still no 🙂 This is because WebSocket requires a special handshake to setup with restrictions. It’s not a free-for-all open-TCP-fest. The approach would … Read more

Convert NSData bytes to NSString?

That’s an important point that should be re-emphasized I think. It turns out that, NSString *content = [NSString stringWithUTF8String:[responseData bytes]]; is not the same as, NSString *content = [[NSString alloc] initWithBytes:[responseData bytes] length:[responseData length] encoding: NSUTF8StringEncoding]; the first expects a NULL terminated byte string, the second doesn’t. In the above two cases content will be … Read more