add tcp support for rpc_ping
This commit is contained in:
parent
9f1fa65239
commit
141ff23dcb
@ -536,8 +536,21 @@ SIGAR_DECLARE(int) sigar_rpc_ping(char *host,
|
||||
interval.tv_usec = 0;
|
||||
addr.sin_port = htons(port);
|
||||
sock = RPC_ANYSOCK;
|
||||
client = clntudp_create(&addr, program, version,
|
||||
|
||||
if (protocol == SIGAR_NETCONN_UDP) {
|
||||
client =
|
||||
clntudp_create(&addr, program, version,
|
||||
interval, &sock);
|
||||
}
|
||||
else if (protocol == SIGAR_NETCONN_TCP) {
|
||||
client =
|
||||
clnttcp_create(&addr, program, version,
|
||||
&sock, 0, 0);
|
||||
}
|
||||
else {
|
||||
return RPC_UNKNOWNPROTO;
|
||||
}
|
||||
|
||||
if (!client) {
|
||||
return rpc_createerr.cf_stat;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user