Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Can't accept connections in WinRT #27

Open
VictimZero opened this issue Aug 13, 2014 · 0 comments
Open

Can't accept connections in WinRT #27

VictimZero opened this issue Aug 13, 2014 · 0 comments

Comments

@VictimZero
Copy link

Is accepting incoming connections supported in WinRT? I've added both Internet (Client & Server) and Private Networks to the capabilities of my app, and have modified the WinRT sample code accept connections and it never connects.

RakPeerInterface *rakPeer = RakPeerInterface::GetInstance();

RakNet::SocketDescriptor socketDescriptor;
socketDescriptor.port = DEFAULT_SERVER_PORT;
socketDescriptor.socketFamily = AF_INET; // IPV4

// Startup the peer interface with the given socket settings.  Will fail if we already have a peer interface for this host
RakNet::StartupResult startupResult = rakPeer->Startup(MAX_CONNECTIONS, &socketDescriptor, 1);
assert(startupResult == RAKNET_STARTED);

// Calling this function starts the peer listening for incoming connections
rakPeer->SetMaximumIncomingConnections(MAX_CONNECTIONS);


Packet *packet;
do 
{
    packet = rakPeer->Receive();
    Sleep(1);
} 
while (!packet || packet->data[0] != ID_NEW_INCOMING_CONNECTION);

RakAssert(packet->data[0] == ID_NEW_INCOMING_CONNECTION);
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant