geerpc/day5 day6 day7: update the function description of XDial

This commit is contained in:
gzdaijie
2020-10-06 19:44:59 +08:00
parent b5646b692b
commit d958ec5dee
3 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -306,7 +306,9 @@ func DialHTTP(network, address string, opts ...*Option) (*Client, error) {
return dialTimeout(dialHTTP, network, address, opts...)
}
// XDial use a general format to represent a rpc server
// XDial calls different functions to connect to a RPC server
// according the first parameter rpcAddr.
// rpcAddr is a general format (protocol@addr) to represent a rpc server
// eg, http@10.0.0.1:7001, tcp@10.0.0.1:9999, unix@/tmp/geerpc.sock
func XDial(rpcAddr string, opts ...*Option) (*Client, error) {
parts := strings.Split(rpcAddr, "@")
+3 -1
View File
@@ -306,7 +306,9 @@ func DialHTTP(network, address string, opts ...*Option) (*Client, error) {
return dialTimeout(dialHTTP, network, address, opts...)
}
// XDial use a general format to represent a rpc server
// XDial calls different functions to connect to a RPC server
// according the first parameter rpcAddr.
// rpcAddr is a general format (protocol@addr) to represent a rpc server
// eg, http@10.0.0.1:7001, tcp@10.0.0.1:9999, unix@/tmp/geerpc.sock
func XDial(rpcAddr string, opts ...*Option) (*Client, error) {
parts := strings.Split(rpcAddr, "@")
+3 -1
View File
@@ -306,7 +306,9 @@ func DialHTTP(network, address string, opts ...*Option) (*Client, error) {
return dialTimeout(dialHTTP, network, address, opts...)
}
// XDial use a general format to represent a rpc server
// XDial calls different functions to connect to a RPC server
// according the first parameter rpcAddr.
// rpcAddr is a general format (protocol@addr) to represent a rpc server
// eg, http@10.0.0.1:7001, tcp@10.0.0.1:9999, unix@/tmp/geerpc.sock
func XDial(rpcAddr string, opts ...*Option) (*Client, error) {
parts := strings.Split(rpcAddr, "@")