Print a parseable route summary for the active connection. Output format: "TEST ROUTE: addr= type= "
| 137 | // Print a parseable route summary for the active connection. |
| 138 | // Output format: "TEST ROUTE: addr=<ip:port> type=<local|udp|relay>" |
| 139 | void 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. |
| 157 | void ResetConnectionCounters() |
no test coverage detected