feat(stream)!: remove limit on concurrent sessions and allow quitting apps with active sessions (#3325)

This commit is contained in:
Cameron Gutman
2024-10-24 19:11:50 -05:00
committed by GitHub
parent d2be83fe20
commit 73d777fa0b
11 changed files with 56 additions and 120 deletions

View File

@@ -163,7 +163,7 @@ namespace net {
}
host_t
host_create(af_e af, ENetAddress &addr, std::size_t peers, std::uint16_t port) {
host_create(af_e af, ENetAddress &addr, std::uint16_t port) {
static std::once_flag enet_init_flag;
std::call_once(enet_init_flag, []() {
enet_initialize();
@@ -173,7 +173,8 @@ namespace net {
enet_address_set_host(&addr, any_addr.data());
enet_address_set_port(&addr, port);
auto host = host_t { enet_host_create(af == IPV4 ? AF_INET : AF_INET6, &addr, peers, 0, 0, 0) };
// Maximum of 128 clients, which should be enough for anyone
auto host = host_t { enet_host_create(af == IPV4 ? AF_INET : AF_INET6, &addr, 128, 0, 0, 0) };
// Enable opportunistic QoS tagging (automatically disables if the network appears to drop tagged packets)
enet_socket_set_option(host->socket, ENET_SOCKOPT_QOS, 1);