-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for ReadOnlySequence as payload #2046
Merged
chkr1011
merged 8 commits into
dotnet:version5
from
mregen:version5_readonlysequence_mini
Jul 24, 2024
Merged
Support for ReadOnlySequence as payload #2046
chkr1011
merged 8 commits into
dotnet:version5
from
mregen:version5_readonlysequence_mini
Jul 24, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chkr1011
approved these changes
Jul 14, 2024
Hi @chkr1011, thanks for the code review! |
mregen
commented
Jul 23, 2024
chkr1011
added a commit
that referenced
this pull request
Aug 24, 2024
* Remove WebSocket4Net extension library * Remove UWP support * Drop support for all old frameworks * Update CI * Update CI * Update CI * Update CI * Remove obsolete code * Set default protocol version to 5.0.0 * Remove obsolete tests * Remove old dependencies * Reset release notes * Move server to dedicated project * Fix unit tests * Update and cleanup nuget packages * Fix unit tests Refactor code * No longer throw exception when receiving non success CONNACK * Enable nuget signing * Enable nuget signing * Enable nuget signing * Enable nuget signing * Enable nuget signing * Enable nuget signing * Enable nuget signing * Enable nuget signing * Enable code signing * Enable code signing * Enable code signing * Fix client endpoint handling * Improve CI * Fix CI * Fix CI * Fix CI * Fix CI * Import changes from version 4 * Cleanup target frameworks and remove obsolete code * Drop support for dotnet7.0 * Remove managed client * Version5 auditmode (#2016) Added NuGet audit mode and some other settings to get informed about security issues. * Address warnings from analyzers * Support for ReadOnlySequence as payload (#2046) * use ReadOnlySequence as payload * fix build * fix build * skip sign in forks * remove unnecessary owner * tests and extensions * remove test * simplify WritePacketBuffer, remove unused helper * Adjust namespaces * Fix build errors * Import latest fixes from main branch * Adjust namespaces --------- Co-authored-by: SeppPenner <[email protected]> Co-authored-by: Martin Regen <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support
ReadOnlySequence
as a payload in the MQTTnet client, for the new version5 release.The MQTTNet write method only accepts an
ArraySegment
which is a view into a single buffer. It is currently necessary to callToArray
to support a RecyclableMemoryStream.As a result, perfomance is affected by additional copies and memory is fragment by the additional random allocation of large buffers.
This is a minimal version without lifetime management in the receive code path to get started.
Since the publish codepath can manage the lifetime of the buffers externally, all publishing applications can already benefit from the implementation.
To minimize the impact on existing code the PayloadSegment setter is kept to convert an ArraySegment to a ReadOnlySequence implicitly, allowing most of the tests to compile unchanged.
Added also a few tests to show how to use a RecyclableMemoryStream.
see #1917 and #1918 with the issue explained.