diff --git a/TCPMaid/Miscellaneous/Channel.cs b/TCPMaid/Miscellaneous/Channel.cs index 49f94ee..09dce43 100644 --- a/TCPMaid/Miscellaneous/Channel.cs +++ b/TCPMaid/Miscellaneous/Channel.cs @@ -416,13 +416,10 @@ private async Task ListenAsync() { return; } } - private sealed class PendingMessage { - public int TotalMessageLength; - public byte[] CurrentBytes; - public PendingMessage(int total_message_length, byte[] initial_bytes) { - TotalMessageLength = total_message_length; - CurrentBytes = initial_bytes; - } + private sealed record PendingMessage(int TotalMessageLength, byte[] CurrentBytes) { + public int TotalMessageLength = TotalMessageLength; + public byte[] CurrentBytes = CurrentBytes; + public bool Incomplete => CurrentBytes.Length < TotalMessageLength; } } \ No newline at end of file