Skip to content

Commit

Permalink
RNET-1175 Fix potential outgoing message corruption in managed websoc…
Browse files Browse the repository at this point in the history
…kets (#3670)

* Fix potential outgoing message corruption in managed websockets

* Update CHANGELOG.md
  • Loading branch information
fealebenpae authored Sep 16, 2024
1 parent 9a82cf2 commit a1ae02c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion Realm/Realm/Native/SyncSocketProvider.WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit a1ae02c

Please sign in to comment.