Trying to use IPv6 to connect two computers. (RakNet and C++)

345 views Asked by At

So I am having some issues trying to get two computers to connect using IPv6 addresses. I have an application where two users can connect and send packets to each other using IPv4 addresses (same wifi). However, due to the coronavirus we have been forced to work all over the states. Because of this, I have been trying to switch to using IPv6. Now according to the RakNet documentation, this should be fairly simple. The TLDR is you set the socket family to be using IPv6 and change a Marco in a RakNet header file.

Source.cpp

    RakNet::SocketDescriptor sd(masterServerPort, "");
    sd.socketFamily = AF_INET6;
    RakNet::StartupResult result =  peer->Startup(MAX_CLIENTS, &sd, 1);
    peer->SetMaximumIncomingConnections(MAX_CLIENTS);


    //std::cout << "The master server has started!\n ";
    std::cout << "Result: " << result << "\n";
    std::cout << "Server IP: " << peer->GetLocalIP(0) << "\n";

RakNetDefines.h

#ifndef RAKNET_SUPPORT_IPV6
#define RAKNET_SUPPORT_IPV6 1
#endif

When I run this program the Startup result comes out to SOCKET_FAMILY_NOT_SUPPORTED and no one can connect. This happens when starting the host machine meaning I don't seem to have a host to connect to. Has anyone else run into this issue? I am using Windows 10 which I believe supports IPv6 by default. Could this be a firewall issue? In my opinion, it couldn't be since I am the one starting the server, but this is out of my expertise. I kinda hit a brick wall so any help would be great.

Another solution I have is using NAT punch-through but that would require an external server that cost money (on a very low budget). I'd like to avoid using extern services as much as possible.

Thanks in advance!

  • Voids

Edit: I am making this application in C++ but using the API RakNet to help with the packets. I believe this to be a RakNet issue in my code, but I am open to suggestions.

Edit: I can't even get a host started up properly so no packets between computers are being sent yet.

0

There are 0 answers