diff --git a/CHANGELOG.md b/CHANGELOG.md index b55485ee09..c7996b45b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ * None ### Fixed -* None +* Fixed a possible disruption of sync traffic under heavy load when using managed web sockets where malformed binary messages cause the server to drop the connection and force the client to reconnect and upload again. (Issue [#3671](https://github.com/realm/realm-dotnet/issues/3671)). ### Compatibility * Realm Studio: 15.0.0 or later. diff --git a/Realm/Realm/Native/SyncSocketProvider.WebSocket.cs b/Realm/Realm/Native/SyncSocketProvider.WebSocket.cs index 5aa91cc811..522a1e7a35 100644 --- a/Realm/Realm/Native/SyncSocketProvider.WebSocket.cs +++ b/Realm/Realm/Native/SyncSocketProvider.WebSocket.cs @@ -124,7 +124,7 @@ public async void Write(BinaryValue data, IntPtr native_callback) try { - await _webSocket.SendAsync(new(buffer), WebSocketMessageType.Binary, true, _cancellationToken); + await _webSocket.SendAsync(new(buffer, 0, (int)data.size), WebSocketMessageType.Binary, true, _cancellationToken); } catch (Exception e) {