Winsock error code 10014
问题 string SendRequestToServer(std::string url) { struct sockaddr_in addr = { 0 }; struct hostent *host = NULL; // If the URL begins with http://, remove it. if(url.find("http://") == 0) url.erase(0, 7); // Get the host name. string hst = url.substr(0, url.find('/', 0)); url.erase(0, url.find("/", 0)); // Connect to the host. host = gethostbyname(hst.c_str()); if(!host) { Print("%s", "Could not resolve the hostname."); int error = WSAGetLastError(); return "failed"; } } It seems I'm returning