mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
判断rpc连接状态
This commit is contained in:
@@ -122,6 +122,11 @@ func (slf *Client) Go(noReply bool,serviceMethod string, args interface{},reply
|
||||
return call
|
||||
}
|
||||
|
||||
if slf.conn == nil {
|
||||
call.Err = fmt.Errorf("call %s is fail,rpc client is disconnect.",serviceMethod)
|
||||
return call
|
||||
}
|
||||
|
||||
err = slf.conn.WriteMsg(bytes)
|
||||
if err != nil {
|
||||
call.Err = err
|
||||
|
||||
Reference in New Issue
Block a user