Setup g_network and start monitoring for network busyness
| 2572 | |
| 2573 | // Setup g_network and start monitoring for network busyness |
| 2574 | void setupNetwork(uint64_t transportId, UseMetrics useMetrics) { |
| 2575 | if (g_network) |
| 2576 | throw network_already_setup(); |
| 2577 | |
| 2578 | if (!networkOptions.logClientInfo.present()) |
| 2579 | networkOptions.logClientInfo = true; |
| 2580 | |
| 2581 | setupGlobalKnobs(); |
| 2582 | g_network = newNet2(tlsConfig, false, useMetrics || networkOptions.traceDirectory.present()); |
| 2583 | g_network->addStopCallback(Net2FileSystem::stop); |
| 2584 | FlowTransport::createInstance(true, transportId, WLTOKEN_RESERVED_COUNT); |
| 2585 | Net2FileSystem::newFileSystem(); |
| 2586 | |
| 2587 | uncancellable(monitorNetworkBusyness()); |
| 2588 | } |
| 2589 | |
| 2590 | void runNetwork() { |
| 2591 | if (!g_network) { |
no test coverage detected