BitTorrent protocol in C