Errore getAddRinfo: ai_socktype non supportato
-
11-11-2019 - |
Domanda
struct addrinfo *myAddrinfo, *curMyAddrinfo, hint;
memset(&hint, 0, sizeof(struct addrinfo));
hint.ai_family = AF_INET;
hint.ai_protocol = AI_PASSIVE;
hint.ai_socktype = SOCK_STREAM;
const int code = getaddrinfo(NULL, SERVER_PORT, &hint, &myAddrinfo);
if ((code) != 0) {
printf("getaddrinfo error occours: %s ",
gai_strerror(code));
return 1;
}
Questo dà l'errore: "ai_socktype non supportato" se commento il hint.ai_protocol = AI_PASSIVE;
Passerà, ma mi chiedo perché succede?
Grazie per il tuo tempo
Nessuna soluzione corretta
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow