NetworkReader/WriterPool: expose Count for testing

This commit is contained in:
mischa 2024-04-24 11:46:34 +08:00 committed by MrGadget
parent 16e2cfab2f
commit 78d511f65f
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,9 @@ public static class NetworkReaderPool
1000 1000
); );
// expose count for testing
public static int Count => Pool.Count;
/// <summary>Get the next reader in the pool. If pool is empty, creates a new Reader</summary> /// <summary>Get the next reader in the pool. If pool is empty, creates a new Reader</summary>
public static NetworkReaderPooled Get(byte[] bytes) public static NetworkReaderPooled Get(byte[] bytes)
{ {

View File

@ -18,6 +18,9 @@ public static class NetworkWriterPool
1000 1000
); );
// expose count for testing
public static int Count => Pool.Count;
/// <summary>Get a writer from the pool. Creates new one if pool is empty.</summary> /// <summary>Get a writer from the pool. Creates new one if pool is empty.</summary>
public static NetworkWriterPooled Get() public static NetworkWriterPooled Get()
{ {