From 4b12fa14dc11ce0bd24bd62e27428978176f0ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Straubmeier?= Date: Tue, 29 Nov 2022 18:15:20 +0100 Subject: [PATCH] Add SendRateMin, SendRateMax and NagleTime to SteamNetworkingUtils --- Facepunch.Steamworks/SteamNetworkingUtils.cs | 37 ++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Facepunch.Steamworks/SteamNetworkingUtils.cs b/Facepunch.Steamworks/SteamNetworkingUtils.cs index 9833d2d..09a2f18 100644 --- a/Facepunch.Steamworks/SteamNetworkingUtils.cs +++ b/Facepunch.Steamworks/SteamNetworkingUtils.cs @@ -191,6 +191,43 @@ namespace Steamworks set => SetConfigInt( NetConfig.SendBufferSize, value ); } + /// + /// Minimum send rate clamp, 0 is no limit. + /// This value will control the min allowed sending rate that + /// bandwidth estimation is allowed to reach. Default is 0 (no-limit) + /// + public static int SendRateMin + { + get => GetConfigInt( NetConfig.SendRateMin ); + set => SetConfigInt( NetConfig.SendRateMin, value ); + } + + /// + /// Maximum send rate clamp, 0 is no limit. + /// This value will control the max allowed sending rate that + /// bandwidth estimation is allowed to reach. Default is 0 (no-limit) + /// + public static int SendRateMax + { + get => GetConfigInt( NetConfig.SendRateMax ); + set => SetConfigInt( NetConfig.SendRateMax, value ); + } + + /// + /// Nagle time, in microseconds. When SendMessage is called, if + /// the outgoing message is less than the size of the MTU, it will be + /// queued for a delay equal to the Nagle timer value. This is to ensure + /// that if the application sends several small messages rapidly, they are + /// coalesced into a single packet. + /// See historical RFC 896. Value is in microseconds. + /// Default is 5000us (5ms). + /// + public static int NagleTime + { + get => GetConfigInt( NetConfig.NagleTime ); + set => SetConfigInt( NetConfig.NagleTime, value ); + } + /// /// Don't automatically fail IP connections that don't have /// strong auth. On clients, this means we will attempt the connection even if