获得公网ip:bool getPublicIp(string& ip) {int sock;char **pptr = NULL;struct sockaddr_in destAddr;struct hostent *ptr = NULL;char destIP[128];sock = socket(AF_INET,SOCK_STREAM,0);if( -1 == sock ){perror("creat socket failed");return false;}bzero((void *)&destAddr,sizeof(destAddr));destAddr.si