mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-03 22:45:13 +08:00
增加动态调用rpc并增加rpc调用超时时间
This commit is contained in:
@@ -291,7 +291,16 @@ func Dial(network, address string) (*Client, error) {
|
||||
}
|
||||
tcpconn, _ := conn.(*net.TCPConn)
|
||||
tcpconn.SetNoDelay(true)
|
||||
return NewClient(conn), nil
|
||||
}
|
||||
|
||||
func DialTimeOut(network, address string, timeout time.Duration) (*Client, error) {
|
||||
conn, err := net.DialTimeout(network, address, timeout)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tcpconn, _ := conn.(*net.TCPConn)
|
||||
tcpconn.SetNoDelay(true)
|
||||
return NewClient(conn), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user