raft/src/rpc
2018-04-11 10:50:11 +08:00
..
client add ntp 2018-04-11 10:46:14 +08:00
server add ntp 2018-04-11 10:46:14 +08:00
ntp.md add docs 2018-04-11 10:50:11 +08:00
ntp.py add docs 2018-04-11 10:50:11 +08:00
README.md add docs 2018-04-11 10:50:11 +08:00

How to run

Server

./server

Client

go

./client

python

python ntp.py

The client output as follow:

Current: 10/23 20:19:05
Current: 10/23 20:19:06
Current: 10/23 20:19:07
Current: 10/23 20:19:08
Current: 10/23 20:19:09
Current: 10/23 20:19:10
RPC call cost 1.482382ms
DEBUG: synced
Current: 10/23 20:20:51
Current: 10/23 20:20:52
Current: 10/23 20:20:53

Notice The address is set to ntp.newnius.com, you have to add 127.0.0.1<tab>ntp.newnius.com in /etc/hosts or change the address to localhost in client.