bool UdpSocket::isConnectNet() //獲取百度的ip地址 如果能獲取到,就證明聯網,返回真 否則返回假
{
struct hostent *host;
host = gethostbyname("www.baidu.com");
if (host)
return true;
else
return false;
}
需要引用個頭文件
#include <netdb.h>
bool UdpSocket::isConnectNet() //獲取百度的ip地址 如果能獲取到,就證明聯網,返回真 否則返回假
{
struct hostent *host;
host = gethostbyname("www.baidu.com");
if (host)
return true;
else
return false;
}
需要引用個頭文件
#include <netdb.h>
kubectl config get-contexts kubectl config use-context <context-name> kubectl config current-context