group2 0.1.0
CSE 125 Group 2
Loading...
Searching...
No Matches
net::UdpSessionTransport::PunchAssist Struct Reference

Direct UDP hole-punch assist for global joins. More...

#include <UdpSessionTransport.hpp>

Public Attributes

std::string directoryHost
 Directory host to re-punch through.
Uint16 directoryPort = 0
 Directory UDP port.
std::vector< std::uint8_t > request
 Pre-encoded PunchRequest envelope.
bool enabled = false

Detailed Description

Direct UDP hole-punch assist for global joins.

While the client connects, it periodically re-sends a directory PunchRequest from THIS session's game socket. That makes the directory record the game socket's NAT mapping (not the throwaway helper socket used to discover the server) and re-notify the host, so the host punches back to the port we actually game on. Without this, port-restricted / symmetric NATs have no pinhole for our ConnectionRequest and the join times out. The request bytes are an opaque pre-encoded directory-control envelope so the transport stays agnostic of the discovery wire format.

Member Data Documentation

◆ directoryHost

std::string net::UdpSessionTransport::PunchAssist::directoryHost

Directory host to re-punch through.

◆ directoryPort

Uint16 net::UdpSessionTransport::PunchAssist::directoryPort = 0

Directory UDP port.

◆ enabled

bool net::UdpSessionTransport::PunchAssist::enabled = false

◆ request

std::vector<std::uint8_t> net::UdpSessionTransport::PunchAssist::request

Pre-encoded PunchRequest envelope.


The documentation for this struct was generated from the following file: