Skip to content

Commit 55d4e68

Browse files
committed
Fix TCP length
1 parent 83adf81 commit 55d4e68

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MatterDotNet/Protocol/Connection/TCPConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public async Task SendFrame(Exchange exchange, Frame frame, bool reliable)
3838
PayloadWriter writer = new PayloadWriter(Frame.MAX_SIZE + 4);
3939
writer.Seek(4);
4040
frame.Serialize(writer, exchange.Session);
41-
BinaryPrimitives.WriteUInt32LittleEndian(writer.GetPayload().Slice(0, 4).Span, (uint)writer.Length);
41+
BinaryPrimitives.WriteUInt32LittleEndian(writer.GetPayload().Slice(0, 4).Span, (uint)writer.Length - 4);
4242
await stream.WriteAsync(writer.GetPayload());
4343
exchange.Session.Timestamp = DateTime.Now;
4444
}

0 commit comments

Comments
 (0)