Skip to content

Commit 00af008

Browse files
committed
feat: Add API to query total number of reliable packets in flight
1 parent 13643a7 commit 00af008

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

LiteNetLib/NetPeer.cs

+14
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,20 @@ public void SetDynamicWindowSize(int size)
312312
reliableChannel.CurrentDynamicWindowSize = size;
313313
}
314314

315+
public int TotalReliablePacketsInFlight
316+
{
317+
get
318+
{
319+
int count = 0;
320+
321+
foreach (var channel in _channels)
322+
if (channel is ReliableChannel reliableChannel)
323+
count += reliableChannel.CurrentPacketsInFlight;
324+
325+
return count;
326+
}
327+
}
328+
315329
/// <summary>
316330
/// Returns packets count in queue for reliable channel
317331
/// </summary>

0 commit comments

Comments
 (0)