Commit graph

290 commits

Author SHA1 Message Date
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
Yuxin Wang
ff423f35f4 Rename package to peer. 2018-09-22 10:52:23 -04:00
Yuxin Wang
e90e26ecd1 Rename and initial commit. 2018-09-21 23:41:12 -04:00
Yuxin Wang
9ef8165dc8 Initial structure commit. 2018-09-21 23:06:33 -04:00
Yuxin Wang
e82166bbfe Initial commit. 2018-09-21 23:06:22 -04:00
Yuxin Wang
57690526e2 Change git ignore. 2018-09-21 23:01:19 -04:00
Yuxin Wang
b4e2ab7c5b Initial commit 2018-09-21 11:23:51 -04:00