Writing a TCP-based RPC service