support ipv6

This commit is contained in:
xfnw 2022-02-18 20:13:36 -05:00
parent 527cd1c5f3
commit 3a2abc58e8

View file

@ -129,13 +129,13 @@ int main(int argc, char *argv[]) {
int socket_desc, client_sock, c; int socket_desc, client_sock, c;
struct sockaddr_in server, client; struct sockaddr_in6 server, client;
socket_desc = socket(AF_INET, SOCK_STREAM, 0); socket_desc = socket(AF_INET6, SOCK_STREAM, 0);
server.sin_family = AF_INET; server.sin6_family = AF_INET6;
server.sin_addr.s_addr = INADDR_ANY; server.sin6_addr = in6addr_any;
server.sin_port = htons(port); server.sin6_port = htons(port);
struct timeval tv; struct timeval tv;
tv.tv_sec = 60; tv.tv_sec = 60;