Commit graph

434 commits

Author SHA1 Message Date
Yuxin Wang
20a9b391ae Rename argument to exclude. 2018-10-13 13:47:07 -04:00
Yuxin Wang
84ad29467c Update chunkinfo without the disconnected peer. 2018-10-13 13:46:36 -04:00
Yuxin Wang
516d14f9ae Add note. 2018-10-13 13:45:00 -04:00
Yuxin Wang
07637719af Unpack rtt in _peers variable. 2018-10-13 13:42:37 -04:00
Yuxin Wang
02936e19a7 Use read_message/write_message from Message package. 2018-10-13 13:38:37 -04:00
Yuxin Wang
1fc3b58d3b Import MessageType from p2pfs.core.message. 2018-10-13 11:12:03 -04:00
Yuxin Wang
d0e9a89ee0 Finish download method, greatly simplify the code. 2018-10-13 00:19:27 -04:00
Yuxin Wang
c3122d3cbb Add _send_request_chunk method. 2018-10-12 23:56:33 -04:00
Yuxin Wang
82413bb307 Add to_download queue and reset the file chunkinfo for updating. 2018-10-12 23:14:36 -04:00
Yuxin Wang
a0cf5c6659 Move download body into DownloadManager. 2018-10-12 22:39:42 -04:00
Yuxin Wang
4d3e632147 Add sliding window size argument to DownloadManager. 2018-10-12 22:39:31 -04:00
Yuxin Wang
b10bc1a155 Store total_chunknum. 2018-10-12 22:37:41 -04:00
Yuxin Wang
6b9800c4d9 Finish update_chunkinfo. 2018-10-12 22:22:14 -04:00
Yuxin Wang
df61039301 Use base class ConnectionError. 2018-10-12 22:06:27 -04:00
Yuxin Wang
438295cd56 Rename the chunk info variable. 2018-10-12 21:55:34 -04:00
Yuxin Wang
21d7006ae5 Put _request_chunkinfo in try block. 2018-10-12 21:46:41 -04:00
Yuxin Wang
caf794ae77 Refactor _update_peer_rtt.
Remove registration if connection is broken.
2018-10-12 21:43:40 -04:00
Yuxin Wang
2ad189cbe4 Put connect method in try except block. 2018-10-12 21:35:04 -04:00
Yuxin Wang
088ccec19c Remove update single rtt method. 2018-10-12 21:29:06 -04:00
Yuxin Wang
3f1a99ad50 Properly initialize download manager. 2018-10-12 20:38:18 -04:00
Yuxin Wang
830bf264f6 Move test rtts into DownloadManager. 2018-10-12 20:38:09 -04:00
Yuxin Wang
13f7409ec2 Use member variable instead of argument. 2018-10-12 20:37:45 -04:00
Yuxin Wang
00686db868 Rename the methods. 2018-10-12 10:39:35 -04:00
Yuxin Wang
1540f8ea69 Remove methods in Peer class. 2018-10-11 23:08:25 -04:00
Yuxin Wang
c9ba7fbe77 Use read_message and write_message function instead of methods.
Also add DownloadManager class.
2018-10-11 23:08:00 -04:00
Yuxin Wang
e4567c45a7 Fix test code. 2018-10-11 23:06:37 -04:00
Yuxin Wang
70f9ea2171 No need to worry about peer's internal server exception. 2018-10-11 21:34:07 -04:00
Yuxin Wang
838207972b Extract read_message/write_message/MessageType into message module. 2018-10-11 21:30:01 -04:00
Yuxin Wang
400be652a5 Add await for is_connected() method. 2018-10-11 20:43:56 -04:00
Yuxin Wang
5574b6de72 Add check for closing writers. 2018-10-11 20:43:38 -04:00
Yuxin Wang
6a50e38aef Allow double stop. 2018-10-11 18:14:33 -04:00
Yuxin Wang
fbdfa28998 Fix typo. 2018-10-11 18:14:07 -04:00
Yuxin Wang
b95d8593f5 Handle ConnectionResetError. 2018-10-11 18:14:01 -04:00
Yuxin Wang
4a1f536ad5 Test connectivity before doing actual work. 2018-10-11 18:13:44 -04:00
Yuxin Wang
b011a374ae list_file now returns 2 results.
1 for file_list, 1 for error message.
2018-10-11 18:10:02 -04:00
Yuxin Wang
9686404267 Add start command for tracker. 2018-10-11 18:08:51 -04:00
Yuxin Wang
d2c4543fbb Add test for tracker disconnect. 2018-10-11 18:08:39 -04:00
Yuxin Wang
2f81ea162a Auto start peer's server and stop the peer/tracker when Ctrl-C is hit. 2018-10-11 17:24:07 -04:00
Yuxin Wang
8df32ffcbf Fix typo. 2018-10-10 21:55:19 -04:00
Yuxin Wang
4babfcbfea Remove unnecessary code. 2018-10-10 21:31:44 -04:00
Yuxin Wang
4829c6a21d Add todo notes. 2018-10-10 21:25:15 -04:00
Yuxin Wang
041bf141d6 Add check if no peer possesses the chunk. 2018-10-10 21:21:11 -04:00
Yuxin Wang
5fffc1dd30 Fix typo. 2018-10-10 21:20:57 -04:00
Yuxin Wang
23420f4304 Move code to common method. 2018-10-10 21:19:45 -04:00
Yuxin Wang
8e5d81cea5 Add more tests for test_tracker_restart. 2018-10-10 21:02:52 -04:00
Yuxin Wang
9d42555e46 Fix is_connected() method. 2018-10-10 21:02:35 -04:00
Yuxin Wang
c8a4d72f19 Add TODO notes. 2018-10-10 20:39:39 -04:00
Yuxin Wang
65ec5f978e Merge branch 're-startable', make peer and tracker re-startable. 2018-10-10 20:35:59 -04:00
Yuxin Wang
7487bc58f8 Add is_connect() and disconnect() method. 2018-10-10 20:35:44 -04:00
Yuxin Wang
a3b72c41a2 Add test for running status. 2018-10-10 20:34:52 -04:00