Skip to content

Commit

Permalink
feat: Add API to set the dynamic window size for all reliable channel…
Browse files Browse the repository at this point in the history
…s on a NetPeer
  • Loading branch information
Frooxius committed Jun 25, 2024
1 parent bc03833 commit 13643a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions LiteNetLib/NetPeer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Threading;
using LiteNetLib.Utils;
Expand Down Expand Up @@ -304,6 +305,13 @@ private void OverrideMtu(int mtuValue)
_finishMtu = true;
}

public void SetDynamicWindowSize(int size)
{
foreach (var channel in _channels)
if (channel is ReliableChannel reliableChannel)
reliableChannel.CurrentDynamicWindowSize = size;
}

/// <summary>
/// Returns packets count in queue for reliable channel
/// </summary>
Expand Down

0 comments on commit 13643a7

Please sign in to comment.