I saw it possible. But I can not. I see what this perchance is. But for me this difficulry.
struct addrinfo addr; struct addrinfo *urlAddr; struct sockaddr_in addrList; char buff[4000]; // addrList = (sockaddr_in *)&((sockaddr_in *)&urlAddr->ai_addr)->sin_addr.s_addr; WSADATA wsaData; int connSock = WSAStartup(MAKEWORD(2, 2), &wsaData); if (0 != connSock) { cout << "Error 1."; } memset(&addr, 0, sizeof(addr)); addr.ai_family = AF_INET; addr.ai_socktype = SOCK_STREAM; addr.ai_protocol = IPPROTO_TCP; int iResult = getaddrinfo((const char *)&"goatghosts.000a.biz", 0, (struct addrinfo *)&addr, &urlAddr); if (iResult != 0) { cout << "Error " << iResult << "\n"; } addrList.sin_family = AF_INET; addrList.sin_addr.s_addr = ((sockaddr_in *)&urlAddr->ai_addr)->sin_addr.s_addr; addrList.sin_port = htons(80); SOCKET so = socket( AF_INET, SOCK_STREAM, IPPROTO_TCP); if (connect(so, (const sockaddr *)&addrList, sizeof(addrList)) != 0) { cout << "Error connect " << WSAGetLastError() << "\n"; } int colbyte = recv(so, buff, sizeof(buff), 0); cout << colbyte; return 0; If you enter ya.ru, then we wait two minutes and give error 10060. And if there is any other address, it instantly gives 10049. Tell me, please, what am I doing wrong?
SOCK_DGRAMwithSOCK_STREAMfor the mail.ru address worked fine. - avp