Added communication with UDP tracker. It should work now.Also added a torrent which has only udp trackers , for testing.
Solved a small bug where UDP trackers like this : udp://tracker.publicbt.com:80/announce wouldn't work
Added timeout at http connection because htp.get doesnt have a timeout. Also changed raw checking of host and protocol with net/url.Url which has everything i needed
added bitfield.Bitfield type
Integrated bitfield into peer. Also added a put function into bitfield.
Added return to all functions so it works on go 1.My mistake
added file writer
started working on full file downloading
Changed to previous peer comm. Added byte parsing in dowloader.
Added messageId in peer communication so we know from who we receive message.
Solved some bugs , corrected the function that gets our next piece to download, and added downloader states
Solved some bugs at file writer. Also added creation of folders to save the files. We now have a first working version of our project. It downloads the data into os.WD/TorrentDownloads
Now the files are not anymore corrrupted , because last piece needed a special treatment :)
fixed typo and file permissions
Modified the way that download starts. Peers now they dont have to wait for each other, when a peer is ready he will start to download. Also added recconect when peer resets his connection.
Forgot about go fmt , my mistake
Solved a slight bug in my last commit
cleaned up small bits of code
Now download runs correctly until finish.Also renamed some variables
Last commit had an error , fixed that