Client --> Server 1.Register/heartbeat 传进一个hash: 自己s/n, publickey, 自己ip, 自己端口? :sn=> :client_ip=>:client_port=> :rpc_client_ip=> #用来回调接受Server命令 :rpc_client_port=> :required_version=>? :supported_version=>? 2.Login(name, password, sn) 3.ask_upload_log_file 4.upload_log_file ==Server --> Client== 注意: Server给Client的命令都有时效性 所以考虑传递 :dispatch_at=>Time.now :valid_within=>30.seconds类似的参数。 And: Please be aware of this is a long-running task or short-run task, of semantics of which. 1.Broadcast_music 2.Open_listen 3.Close_listen 4.update_log_level ==Some Note about Rpc== Although unlikely, it is possible that the RPC server will die just after sending us the answer, but before sending an acknowledgment message for the request. If that happens, the restarted RPC server will process the request again. That's why on the client we must handle the duplicate responses gracefully, and the RPC should ideally be idempotent.