From acb87931400d708f467b7c33c3ce0c2d55cb4988 Mon Sep 17 00:00:00 2001 From: winlin Date: Tue, 23 Jun 2020 18:31:27 +0800 Subject: [PATCH] RTC: Change reuseport to 1 --- trunk/conf/full.conf | 4 ++-- trunk/src/app/srs_app_config.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/trunk/conf/full.conf b/trunk/conf/full.conf index 9844f51bd..a028598c2 100644 --- a/trunk/conf/full.conf +++ b/trunk/conf/full.conf @@ -440,8 +440,8 @@ rtc_server { # We listen multiple times at the same port, by REUSEPORT, to increase the UDP queue. # Note that you can set to 1 and increase the system UDP buffer size by net.core.rmem_max # and net.core.rmem_default or just increase this to get larger UDP recv and send buffer. - # default: 4 - reuseport 4; + # default: 1 + reuseport 1; # Whether merge multiple NALUs into one. # @see https://github.com/ossrs/srs/issues/307#issuecomment-612806318 # default: on diff --git a/trunk/src/app/srs_app_config.cpp b/trunk/src/app/srs_app_config.cpp index fea008bc4..302a068a5 100644 --- a/trunk/src/app/srs_app_config.cpp +++ b/trunk/src/app/srs_app_config.cpp @@ -4820,8 +4820,10 @@ int SrsConfig::get_rtc_server_reuseport() int v = get_rtc_server_reuseport2(); #if !defined(SO_REUSEPORT) - srs_warn("REUSEPORT not supported, reset %d to %d", reuseport, DEFAULT); - v = 1 + if (v > 1) { + srs_warn("REUSEPORT not supported, reset %d to %d", reuseport, DEFAULT); + v = 1 + } #endif return v; @@ -4829,7 +4831,7 @@ int SrsConfig::get_rtc_server_reuseport() int SrsConfig::get_rtc_server_reuseport2() { - static int DEFAULT = 4; + static int DEFAULT = 1; SrsConfDirective* conf = root->get("rtc_server"); if (!conf) {