]> git.vomp.tv Git - vompserver.git/commitdiff
IPv6 support for main protocol
authorChris Tallon <chris@vomp.tv>
Wed, 9 Oct 2019 15:36:33 +0000 (16:36 +0100)
committerChris Tallon <chris@vomp.tv>
Wed, 9 Oct 2019 15:36:33 +0000 (16:36 +0100)
mvpserver.c

index bbf8fbd3828bd27f65afe14bf1744fb5d4e46b56..15890fbefc34086597e0664a985c3280f91ec793 100644 (file)
@@ -300,6 +300,7 @@ void MVPServer::threadMethod()
   pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
   pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
 
+  /*
   struct sockaddr_in address;
   address.sin_family = AF_INET;
   address.sin_port = htons(tcpServerPort);
@@ -307,6 +308,17 @@ void MVPServer::threadMethod()
   socklen_t length = sizeof(address);
 
   listeningSocket = socket(AF_INET, SOCK_STREAM, 0);
+  */
+
+  struct sockaddr_in6 address;
+  address.sin6_family = AF_INET6;
+  address.sin6_port = htons(tcpServerPort);
+  address.sin6_addr = in6addr_any;
+  socklen_t length = sizeof(address);
+
+  listeningSocket = socket(AF_INET6, SOCK_STREAM, 0);
+
+
   if (listeningSocket < 0)
   {
     log.log("MVPServer", Log::CRIT, "Could not get TCP socket in vompserver");