Skip to content

Instantly share code, notes, and snippets.

@bkhanale
Last active November 10, 2018 16:25
Show Gist options
  • Save bkhanale/b8e7621b53decaf561fc836956d2358e to your computer and use it in GitHub Desktop.
Save bkhanale/b8e7621b53decaf561fc836956d2358e to your computer and use it in GitHub Desktop.
Server is listnening on 127.0.0.1
21:53:37: accept_connections_thread :127.0.0.1:54522 has connected.
21:53:37: client 127.0.0.1:54522 thread :Start thread for this client
21:53:37: client 127.0.0.1:54522 thread :Server receive register message
{'user_name': 'bhush', 'text': 'Hello', 'time': '21:53'}
21:53:37: client 127.0.0.1:54522 thread :Send to ('127.0.0.1', 33000)
msg= {'user_name': 'Server', 'text': 'Welcome bhush! If you ever want to quit, type {quit} to exit\n', 'time': '21:53'}
21:53:37: client 127.0.0.1:54522 thread :Start broadcasting
{'user_name': 'Server', 'text': 'bhush has joined the chat!\n', 'time': '21:53'}
21:53:37: client 127.0.0.1:54522 thread :Finish broadcasting
21:53:51: client 127.0.0.1:54522 thread :Incoming message from ('127.0.0.1', 33000)
message = {'user_name': 'bhush', 'text': 'Hello', 'time': '21:53'}
21:53:51: client 127.0.0.1:54522 thread :Broadcasting the message
21:53:51: client 127.0.0.1:54522 thread :Success
21:53:51: client 127.0.0.1:54522 thread :Block #1 is mined.
21:53:51: client 127.0.0.1:54522 thread :{"length": 2, "chain": [{"index": 0, "transactions": [], "timestamp": 1541867003.1203628, "previous_hash": "0", "nonce": 0, "hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72"}, {"index": 1, "transactions": [{"user_name": "bhush", "text": "Hello", "time": "21:53"}], "timestamp": 1541867031.3326483, "previous_hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72", "nonce": 18, "hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9"}]}
21:53:51: client 127.0.0.1:54522 thread :Start broadcasting
{'user_name': 'bhush', 'text': 'Hello', 'time': '21:53'}
21:53:51: client 127.0.0.1:54522 thread :sent to 127.0.0.1:33000
21:53:51: client 127.0.0.1:54522 thread :Finish broadcasting
21:54:05: client 127.0.0.1:54522 thread :Incoming message from ('127.0.0.1', 33000)
message = {'user_name': 'bhush', 'text': 'This is message no. 2', 'time': '21:54'}
21:54:05: client 127.0.0.1:54522 thread :Broadcasting the message
21:54:05: client 127.0.0.1:54522 thread :Success
21:54:05: client 127.0.0.1:54522 thread :Block #2 is mined.
21:54:05: client 127.0.0.1:54522 thread :{"length": 3, "chain": [{"index": 0, "transactions": [], "timestamp": 1541867003.1203628, "previous_hash": "0", "nonce": 0, "hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72"}, {"index": 1, "transactions": [{"user_name": "bhush", "text": "Hello", "time": "21:53"}], "timestamp": 1541867031.3326483, "previous_hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72", "nonce": 18, "hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9"}, {"index": 2, "transactions": [{"user_name": "bhush", "text": "This is message no. 2", "time": "21:54"}], "timestamp": 1541867045.4860835, "previous_hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9", "nonce": 192, "hash": "003023defd32c62b370fd2a3518e4e654353a6f481402ec573a3b00df80d5ad7"}]}
21:54:05: client 127.0.0.1:54522 thread :Start broadcasting
{'user_name': 'bhush', 'text': 'This is message no. 2', 'time': '21:54'}
21:54:05: client 127.0.0.1:54522 thread :sent to 127.0.0.1:33000
21:54:05: client 127.0.0.1:54522 thread :Finish broadcasting
21:54:17: client 127.0.0.1:54522 thread :Incoming message from ('127.0.0.1', 33000)
message = {'user_name': 'bhush', 'text': 'This is message no. 3', 'time': '21:54'}
21:54:17: client 127.0.0.1:54522 thread :Broadcasting the message
21:54:17: client 127.0.0.1:54522 thread :Success
21:54:17: client 127.0.0.1:54522 thread :Block #3 is mined.
21:54:17: client 127.0.0.1:54522 thread :{"length": 4, "chain": [{"index": 0, "transactions": [], "timestamp": 1541867003.1203628, "previous_hash": "0", "nonce": 0, "hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72"}, {"index": 1, "transactions": [{"user_name": "bhush", "text": "Hello", "time": "21:53"}], "timestamp": 1541867031.3326483, "previous_hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72", "nonce": 18, "hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9"}, {"index": 2, "transactions": [{"user_name": "bhush", "text": "This is message no. 2", "time": "21:54"}], "timestamp": 1541867045.4860835, "previous_hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9", "nonce": 192, "hash": "003023defd32c62b370fd2a3518e4e654353a6f481402ec573a3b00df80d5ad7"}, {"index": 3, "transactions": [{"user_name": "bhush", "text": "This is message no. 3", "time": "21:54"}], "timestamp": 1541867057.2197928, "previous_hash": "003023defd32c62b370fd2a3518e4e654353a6f481402ec573a3b00df80d5ad7", "nonce": 295, "hash": "000304e30fba36888290b7472eb5583cc8168efd0d08434c2778a965654f8b96"}]}
21:54:17: client 127.0.0.1:54522 thread :Start broadcasting
{'user_name': 'bhush', 'text': 'This is message no. 3', 'time': '21:54'}
21:54:17: client 127.0.0.1:54522 thread :sent to 127.0.0.1:33000
21:54:17: client 127.0.0.1:54522 thread :Finish broadcasting
21:54:36: accept_connections_thread :127.0.0.1:54524 has connected.
21:54:36: client 127.0.0.1:54524 thread :Start thread for this client
21:54:36: client 127.0.0.1:54524 thread :Server receive register message
{'user_name': 'shubh', 'text': 'Hello', 'time': '21:54'}
21:54:36: client 127.0.0.1:54524 thread :Send to ('127.0.0.1', 33000)
msg= {'user_name': 'Server', 'text': 'Welcome shubh! If you ever want to quit, type {quit} to exit\n', 'time': '21:54'}
21:54:36: client 127.0.0.1:54524 thread :Start broadcasting
{'user_name': 'Server', 'text': 'shubh has joined the chat!\n', 'time': '21:54'}
21:54:36: client 127.0.0.1:54524 thread :sent to 127.0.0.1:33000
21:54:36: client 127.0.0.1:54524 thread :Finish broadcasting
21:54:44: client 127.0.0.1:54524 thread :Incoming message from ('127.0.0.1', 33000)
message = {'user_name': 'shubh', 'text': 'Hello bhush', 'time': '21:54'}
21:54:44: client 127.0.0.1:54524 thread :Broadcasting the message
21:54:44: client 127.0.0.1:54524 thread :Success
21:54:44: client 127.0.0.1:54524 thread :Block #4 is mined.
21:54:44: client 127.0.0.1:54524 thread :{"length": 5, "chain": [{"index": 0, "transactions": [], "timestamp": 1541867003.1203628, "previous_hash": "0", "nonce": 0, "hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72"}, {"index": 1, "transactions": [{"user_name": "bhush", "text": "Hello", "time": "21:53"}], "timestamp": 1541867031.3326483, "previous_hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72", "nonce": 18, "hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9"}, {"index": 2, "transactions": [{"user_name": "bhush", "text": "This is message no. 2", "time": "21:54"}], "timestamp": 1541867045.4860835, "previous_hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9", "nonce": 192, "hash": "003023defd32c62b370fd2a3518e4e654353a6f481402ec573a3b00df80d5ad7"}, {"index": 3, "transactions": [{"user_name": "bhush", "text": "This is message no. 3", "time": "21:54"}], "timestamp": 1541867057.2197928, "previous_hash": "003023defd32c62b370fd2a3518e4e654353a6f481402ec573a3b00df80d5ad7", "nonce": 295, "hash": "000304e30fba36888290b7472eb5583cc8168efd0d08434c2778a965654f8b96"}, {"index": 4, "transactions": [{"user_name": "shubh", "text": "Hello bhush", "time": "21:54"}], "timestamp": 1541867084.0880713, "previous_hash": "000304e30fba36888290b7472eb5583cc8168efd0d08434c2778a965654f8b96", "nonce": 199, "hash": "00c85c12aa9153660efbd9bca9f1192850b8a74ccacbded4528711b36a35587c"}]}
21:54:44: client 127.0.0.1:54524 thread :Start broadcasting
{'user_name': 'shubh', 'text': 'Hello bhush', 'time': '21:54'}
21:54:44: client 127.0.0.1:54524 thread :sent to 127.0.0.1:33000
21:54:44: client 127.0.0.1:54524 thread :sent to 127.0.0.1:33000
21:54:44: client 127.0.0.1:54524 thread :Finish broadcasting
21:54:55: client 127.0.0.1:54524 thread :Incoming message from ('127.0.0.1', 33000)
message = {'user_name': 'shubh', 'text': 'This is message no. 2 from shubh', 'time': '21:54'}
21:54:55: client 127.0.0.1:54524 thread :Broadcasting the message
21:54:55: client 127.0.0.1:54524 thread :Success
21:54:55: client 127.0.0.1:54524 thread :Block #5 is mined.
21:54:55: client 127.0.0.1:54524 thread :{"length": 6, "chain": [{"index": 0, "transactions": [], "timestamp": 1541867003.1203628, "previous_hash": "0", "nonce": 0, "hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72"}, {"index": 1, "transactions": [{"user_name": "bhush", "text": "Hello", "time": "21:53"}], "timestamp": 1541867031.3326483, "previous_hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72", "nonce": 18, "hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9"}, {"index": 2, "transactions": [{"user_name": "bhush", "text": "This is message no. 2", "time": "21:54"}], "timestamp": 1541867045.4860835, "previous_hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9", "nonce": 192, "hash": "003023defd32c62b370fd2a3518e4e654353a6f481402ec573a3b00df80d5ad7"}, {"index": 3, "transactions": [{"user_name": "bhush", "text": "This is message no. 3", "time": "21:54"}], "timestamp": 1541867057.2197928, "previous_hash": "003023defd32c62b370fd2a3518e4e654353a6f481402ec573a3b00df80d5ad7", "nonce": 295, "hash": "000304e30fba36888290b7472eb5583cc8168efd0d08434c2778a965654f8b96"}, {"index": 4, "transactions": [{"user_name": "shubh", "text": "Hello bhush", "time": "21:54"}], "timestamp": 1541867084.0880713, "previous_hash": "000304e30fba36888290b7472eb5583cc8168efd0d08434c2778a965654f8b96", "nonce": 199, "hash": "00c85c12aa9153660efbd9bca9f1192850b8a74ccacbded4528711b36a35587c"}, {"index": 5, "transactions": [{"user_name": "shubh", "text": "This is message no. 2 from shubh", "time": "21:54"}], "timestamp": 1541867095.096719, "previous_hash": "00c85c12aa9153660efbd9bca9f1192850b8a74ccacbded4528711b36a35587c", "nonce": 90, "hash": "00b14adf6387f3299db6944c84cf1f9d1875edb66f82199e3131eb2a89d67dbd"}]}
21:54:55: client 127.0.0.1:54524 thread :Start broadcasting
{'user_name': 'shubh', 'text': 'This is message no. 2 from shubh', 'time': '21:54'}
21:54:55: client 127.0.0.1:54524 thread :sent to 127.0.0.1:33000
21:54:55: client 127.0.0.1:54524 thread :sent to 127.0.0.1:33000
21:54:55: client 127.0.0.1:54524 thread :Finish broadcasting
21:55:15: client 127.0.0.1:54524 thread :Incoming message from ('127.0.0.1', 33000)
message = {'user_name': 'shubh', 'text': 'Okay, I think its working as expected', 'time': '21:55'}
21:55:15: client 127.0.0.1:54524 thread :Broadcasting the message
21:55:15: client 127.0.0.1:54524 thread :Success
21:55:15: client 127.0.0.1:54524 thread :Block #6 is mined.
21:55:15: client 127.0.0.1:54524 thread :{"length": 7, "chain": [{"index": 0, "transactions": [], "timestamp": 1541867003.1203628, "previous_hash": "0", "nonce": 0, "hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72"}, {"index": 1, "transactions": [{"user_name": "bhush", "text": "Hello", "time": "21:53"}], "timestamp": 1541867031.3326483, "previous_hash": "796e734e4e584f107e6abb379e34fa96e00c56f581f58d54099f92c394aa2b72", "nonce": 18, "hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9"}, {"index": 2, "transactions": [{"user_name": "bhush", "text": "This is message no. 2", "time": "21:54"}], "timestamp": 1541867045.4860835, "previous_hash": "00befb42d1119bfccfa35e32816599d40f99c1c804f27707027d210e9afb43e9", "nonce": 192, "hash": "003023defd32c62b370fd2a3518e4e654353a6f481402ec573a3b00df80d5ad7"}, {"index": 3, "transactions": [{"user_name": "bhush", "text": "This is message no. 3", "time": "21:54"}], "timestamp": 1541867057.2197928, "previous_hash": "003023defd32c62b370fd2a3518e4e654353a6f481402ec573a3b00df80d5ad7", "nonce": 295, "hash": "000304e30fba36888290b7472eb5583cc8168efd0d08434c2778a965654f8b96"}, {"index": 4, "transactions": [{"user_name": "shubh", "text": "Hello bhush", "time": "21:54"}], "timestamp": 1541867084.0880713, "previous_hash": "000304e30fba36888290b7472eb5583cc8168efd0d08434c2778a965654f8b96", "nonce": 199, "hash": "00c85c12aa9153660efbd9bca9f1192850b8a74ccacbded4528711b36a35587c"}, {"index": 5, "transactions": [{"user_name": "shubh", "text": "This is message no. 2 from shubh", "time": "21:54"}], "timestamp": 1541867095.096719, "previous_hash": "00c85c12aa9153660efbd9bca9f1192850b8a74ccacbded4528711b36a35587c", "nonce": 90, "hash": "00b14adf6387f3299db6944c84cf1f9d1875edb66f82199e3131eb2a89d67dbd"}, {"index": 6, "transactions": [{"user_name": "shubh", "text": "Okay, I think its working as expected", "time": "21:55"}], "timestamp": 1541867115.4567485, "previous_hash": "00b14adf6387f3299db6944c84cf1f9d1875edb66f82199e3131eb2a89d67dbd", "nonce": 91, "hash": "00b2743b2a9490b05214596551d06c8ed75874e23e21d6d29428061717e520f5"}]}
21:55:15: client 127.0.0.1:54524 thread :Start broadcasting
{'user_name': 'shubh', 'text': 'Okay, I think its working as expected', 'time': '21:55'}
21:55:15: client 127.0.0.1:54524 thread :sent to 127.0.0.1:33000
21:55:15: client 127.0.0.1:54524 thread :sent to 127.0.0.1:33000
21:55:15: client 127.0.0.1:54524 thread :Finish broadcasting
21:55:22: client 127.0.0.1:54524 thread :Client 127.0.0.1:33000 has disconnected
21:55:22: client 127.0.0.1:54524 thread :client 127.0.0.1:33000 deleted
21:55:22: client 127.0.0.1:54524 thread :Broadcasting message shubh has left the chat
21:55:22: client 127.0.0.1:54524 thread :Start broadcasting
{'user_name': 'Server', 'text': 'shubh has left the chat.\n', 'time': '21:55'}
21:55:22: client 127.0.0.1:54524 thread :sent to 127.0.0.1:33000
21:55:22: client 127.0.0.1:54524 thread :Finish broadcasting
21:55:22: client 127.0.0.1:54524 thread :thread is finished
21:55:27: client 127.0.0.1:54522 thread :Client 127.0.0.1:33000 has disconnected
21:55:27: client 127.0.0.1:54522 thread :client 127.0.0.1:33000 deleted
21:55:27: client 127.0.0.1:54522 thread :Broadcasting message bhush has left the chat
21:55:27: client 127.0.0.1:54522 thread :Start broadcasting
{'user_name': 'Server', 'text': 'bhush has left the chat.\n', 'time': '21:55'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment