|
Lines 48-54
Link Here
|
| 48 |
if((tSock==-1) && (pAddrInfo->ai_family == AF_INET6) && (errno == EAFNOSUPPORT)) |
48 |
if((tSock==-1) && (pAddrInfo->ai_family == AF_INET6) && (errno == EAFNOSUPPORT)) |
| 49 |
{ |
49 |
{ |
| 50 |
//Fallback to ipv4 |
50 |
//Fallback to ipv4 |
| 51 |
perror("Failed to create ipv6 socket. Trying ipv4"); |
51 |
xprintf("Failed to create ipv6 socket. Trying ipv4"); |
| 52 |
pAddrInfo->ai_family = AF_INET; |
52 |
pAddrInfo->ai_family = AF_INET; |
| 53 |
tSock = socket(pAddrInfo->ai_family, pAddrInfo->ai_socktype, 0); |
53 |
tSock = socket(pAddrInfo->ai_family, pAddrInfo->ai_socktype, 0); |
| 54 |
} |
54 |
} |
|
Lines 158-165
Link Here
|
| 158 |
sprintf(tService, "%d", pPort); // copies port to string |
158 |
sprintf(tService, "%d", pPort); // copies port to string |
| 159 |
int tFamily = AF_INET; |
159 |
int tFamily = AF_INET; |
| 160 |
#ifdef AF_INET6 |
160 |
#ifdef AF_INET6 |
| 161 |
//printf("Listening on IPv6 Socket\n"); |
161 |
xprintf("Listening on IPv6 Socket\n"); |
| 162 |
//tFamily = AF_INET6; |
162 |
tFamily = AF_INET6; |
| 163 |
#else |
163 |
#else |
| 164 |
//printf("Listening on IPv4 Socket"); |
164 |
//printf("Listening on IPv4 Socket"); |
| 165 |
#endif |
165 |
#endif |