Commit graph

306 commits

Author SHA1 Message Date
Yuxin Wang
23f269d63c Add thread-safety as a TODO. 2018-09-26 17:20:16 -04:00
Yuxin Wang
2eeb3fa529 Add more notes. 2018-09-26 16:23:11 -04:00
Yuxin Wang
16f66910a2 Implement simple cmd terminal. 2018-09-26 11:12:39 -04:00
Yuxin Wang
f7d5c0db35 Improve notes. 2018-09-26 11:12:24 -04:00
Yuxin Wang
01ff331b58 Add public interfaces of states. 2018-09-26 11:12:16 -04:00
Yuxin Wang
fa54c18507 Manage chunkinfo separately. 2018-09-26 11:12:00 -04:00
Yuxin Wang
e88464469a Chunkinfo is managed by another command. 2018-09-26 11:11:25 -04:00
Yuxin Wang
d7f6bbdb0a Rename PeerServer to Peer. 2018-09-26 10:35:37 -04:00
Yuxin Wang
8ad60f73da Rename module utils to server. 2018-09-26 09:59:56 -04:00
Yuxin Wang
d0c0abe00e Rename the module to tracker. 2018-09-26 09:59:07 -04:00
Yuxin Wang
4b8caa06cf Rename the central server to tracker. 2018-09-26 09:58:52 -04:00
Yuxin Wang
21f7fdc8d7 Implement publish and list file. 2018-09-26 09:49:25 -04:00
Yuxin Wang
df42d117d7 Add 2 messages. 2018-09-26 09:48:46 -04:00
Yuxin Wang
93f574c517 Add publish method. 2018-09-25 21:17:56 -04:00
Yuxin Wang
7b8d8f113c Send request after peer server has started. 2018-09-25 15:57:49 -04:00
Yuxin Wang
dd7073296c Use non-blocking method. 2018-09-25 15:57:31 -04:00
Yuxin Wang
7ec372ad97 Add non-blocking start method.
Add signal _server_started.
2018-09-25 15:57:22 -04:00
Yuxin Wang
291d7cbe9e Use uuid instead of serial number. 2018-09-25 15:45:02 -04:00
Yuxin Wang
cc47037ee1 Handle PEER_GREET. 2018-09-25 14:30:10 -04:00
Yuxin Wang
f3e40838cb Distinguish server sock and other clients. 2018-09-25 14:29:57 -04:00
Yuxin Wang
4ac21568fd Store id of each peer. 2018-09-25 14:29:16 -04:00
Yuxin Wang
998daaaa59 Handle REQUEST_REGISTER. 2018-09-25 14:28:11 -04:00
Yuxin Wang
993b1050de Store id in server. 2018-09-25 14:27:56 -04:00
Yuxin Wang
747d7890b2 Add request register codes. 2018-09-25 13:21:42 -04:00
Yuxin Wang
a45928a20c Remove REPLY_PEER_LIST/ Add PEER_GREET. 2018-09-25 13:20:57 -04:00
Yuxin Wang
eccd48e08b Output debug messages. 2018-09-25 13:20:38 -04:00
Yuxin Wang
64d28e6490 Output to debug channel. 2018-09-25 13:20:28 -04:00
Yuxin Wang
4c31685d4d Log before new connection is processed. 2018-09-25 12:45:55 -04:00
Yuxin Wang
b36df3f9d0 Output debug message about the incoming packets. 2018-09-25 10:25:53 -04:00
Yuxin Wang
1deba980bf Use simple enum class to represent message types. 2018-09-25 10:12:24 -04:00
Yuxin Wang
7abc057ac7 Add client when connected. 2018-09-25 10:00:55 -04:00
Yuxin Wang
22865f9ce6 Remove client when closed. 2018-09-25 10:00:45 -04:00
Yuxin Wang
bdde485c7c Add debug output. 2018-09-25 10:00:32 -04:00
Yuxin Wang
a7857d257d Use connect method of MessageServer. 2018-09-25 09:59:57 -04:00
Yuxin Wang
eb359ee1f0 Add connect method.
Auto-handling the connected socket.
2018-09-25 09:59:33 -04:00
Yuxin Wang
bd873b33a0 Make recvall method private. 2018-09-25 09:59:11 -04:00
Yuxin Wang
45de290bf7 Guard the operations. 2018-09-25 00:09:09 -04:00
Yuxin Wang
9294e72cf3 Add code for handling server connection refused. 2018-09-24 22:55:26 -04:00
Yuxin Wang
f0111162fc Commit main method. 2018-09-24 22:47:02 -04:00
Yuxin Wang
90f00d9ad0 Remove logs in subclasses. 2018-09-24 22:46:39 -04:00
Yuxin Wang
aca3d5d7fd Add dependency for coloredlogs. 2018-09-24 22:46:00 -04:00
Yuxin Wang
adcefbdd35 Add log for all operations. 2018-09-24 22:45:50 -04:00
Yuxin Wang
62787467d5 Change the signature of _client_connected method. 2018-09-24 21:50:42 -04:00
Yuxin Wang
b829654b56 Initial commit of PeerServer. 2018-09-24 21:37:29 -04:00
Yuxin Wang
4575b63753 Initial commit of CentralServer.
Print the message it receives.
2018-09-24 21:37:10 -04:00
Yuxin Wang
567129e0cc Remove the address part since client.getpeername() will do the job. 2018-09-24 16:55:24 -04:00
Yuxin Wang
3bcafb046b Fix call to self._process_message method. 2018-09-24 16:48:31 -04:00
Yuxin Wang
8386f52044 Commit the common MessageServer. 2018-09-24 16:36:45 -04:00
Yuxin Wang
65900beecc Use dict instead of enum for easier transmission. 2018-09-22 17:19:27 -04:00
Yuxin Wang
fe41d2f2a6 Initial commit. 2018-09-22 10:53:02 -04:00