aboutsummaryrefslogtreecommitdiff
path: root/lib/Net.Messaging.FBM
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-01-18 22:43:14 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2023-01-18 22:43:14 -0500
commit46caaac9debdaad496c07af9d3806e67a447066c (patch)
tree750bebaa5f3b59f06792b99de8a6fae995452bca /lib/Net.Messaging.FBM
parent52b8e30437e235817ed534dec860e781bb0468c0 (diff)
Heap diag and plugin log file names
Diffstat (limited to 'lib/Net.Messaging.FBM')
-rw-r--r--lib/Net.Messaging.FBM/src/Client/Helpers.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Net.Messaging.FBM/src/Client/Helpers.cs b/lib/Net.Messaging.FBM/src/Client/Helpers.cs
index 8f895fa..054a30b 100644
--- a/lib/Net.Messaging.FBM/src/Client/Helpers.cs
+++ b/lib/Net.Messaging.FBM/src/Client/Helpers.cs
@@ -78,6 +78,7 @@ namespace VNLib.Net.Messaging.FBM
/// Alloctes a random integer to use as a message id
/// </summary>
public static int RandomMessageId => RandomNumberGenerator.GetInt32(1, int.MaxValue);
+
/// <summary>
/// Gets the remaining data after the current position of the stream.
/// </summary>
@@ -197,7 +198,7 @@ namespace VNLib.Net.Messaging.FBM
/// <param name="header">The <see cref="HeaderCommand"/> of the header</param>
/// <param name="value">The value of the header</param>
/// <param name="encoding">Encoding to use when writing character message</param>
- /// <exception cref="OutOfMemoryException"></exception>
+ /// <exception cref="ArgumentOutOfRangeException"></exception>
public static void WriteHeader(ref this ForwardOnlyWriter<byte> buffer, byte header, ReadOnlySpan<char> value, Encoding encoding)
{
//get char count
@@ -205,7 +206,7 @@ namespace VNLib.Net.Messaging.FBM
//make sure there is enough room in the buffer
if (buffer.RemainingSize < byteCount)
{
- throw new OutOfMemoryException();
+ throw new ArgumentOutOfRangeException(nameof(value),"The internal buffer is too small to write header");
}
//Write header command enum value
buffer.Append(header);