server

type Yqmiot int

func (iot Yqmiot) Report(req ReportRequest, resp ReportRespone) error {

}

var yqmiot Yqmiot
rpc.Register(&yqmiot)
rpc.HandleHTTP()
http.ListenAndServe(":8000", nil)

client

r, err = rpc.DialHTTP("tcp", "localhost:8000")

var req ReportRequest
var resp ReportRespone
req.xxx = xxx
err = r.Call("Yqmiot.Report", req, &resp)

标签: none

添加新评论