MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / PrintRouteInfo

Function PrintRouteInfo

tests/test_p2p.cpp:139–154  ·  view source on GitHub ↗

Print a parseable route summary for the active connection. Output format: "TEST ROUTE: addr= type= "

Source from the content-addressed store, hash-verified

137// Print a parseable route summary for the active connection.
138// Output format: "TEST ROUTE: addr=<ip:port> type=<local|udp|relay>"
139void PrintRouteInfo()
140{
141 SteamNetConnectionInfo_t info;
142 if ( !SteamNetworkingSockets()->GetConnectionInfo( g_hConnection, &info ) )
143 return;
144 const char *pszType;
145 if ( info.m_nFlags & k_nSteamNetworkConnectionInfoFlags_Relayed )
146 pszType = "relay";
147 else if ( info.m_nFlags & k_nSteamNetworkConnectionInfoFlags_Fast )
148 pszType = "local";
149 else
150 pszType = "udp";
151 char szAddr[64];
152 info.m_addrRemote.ToString( szAddr, sizeof(szAddr), true );
153 TEST_Printf( "TEST ROUTE: addr=%s type=%s\n", szAddr, pszType );
154}
155
156// Reset all per-connection counters. Called at the start of each new connection.
157void ResetConnectionCounters()

Callers 2

mainFunction · 0.85

Calls 4

SteamNetworkingSocketsFunction · 0.85
TEST_PrintfFunction · 0.85
GetConnectionInfoMethod · 0.80
ToStringMethod · 0.45

Tested by

no test coverage detected