improve rpc protocol and support heatbeat message.