Support streams when sending and/or receiving
See original GitHub issueDescribe the feature request
The MqttApplicationMessage
only supports byte[]
but it would be nice if it would support a Stream object. The MQTT spec allows for 256MB payloads and using streams makes sense from both when sending and receiving. For example, the ability to pass a FileStream and especially useful if the stream is still being written to.
Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Example. I’m am trying to do […] but […]
Which project is your feature request related to?
- Client
Describe the solution you’d like
Support streams when sending and/or receiving
Describe alternatives you’ve considered
The payload byte[] requires all data to be first loaded into memory which is not ideal when dealing with large data fragments and results in unneeded memory pressure.
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (5 by maintainers)
Top Results From Across the Web
New series Andor will not play at all on Disney+ for me ...
No idea. Only thing that worked for me was getting it to start on the tv and then going back to shield so...
Read more >How to Watch Andor on Disney+: Stream New Star Wars ...
'Andor' follows Cassian Andor's journey in the prequel to 'Rouge One' — here's how to stream the entire first season of the Star...
Read more >Andor Creator Gets Honest About Why He Feels Streaming ...
Andor creator Tony Gilroy is thankful for his series' success, but still has honest thoughts on how streaming is 'ruining' the entertainment ...
Read more >How to watch Andor on Disney Plus: Stream Episodes 1-3 ...
Here's how you can stream the new Star Wars show. Cassian Andor was among the heroes of Rogue One, the prequel to Episode...
Read more >How to Stream the 'Star Wars' Prequel Series on Disney+
Andor is streaming exclusively on Disney+, at no extra cost to subscribers. For those who haven't signed up for Disney+, monthly subscriptions ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ramonsmits I think it would have to be a ReadOnlyMemory<Byte> as a Spans can only exists on the Stack, not the Heap.
@chkr1011 Just a small suggestion: Wouldn’t just allocating a new buffer here
https://github.com/chkr1011/MQTTnet/blob/b88924bce50671b4270282f4ca7ec10e429eaa49/Source/MQTTnet/Formatter/MqttPacketWriter.cs#L214
be more effective as Array.Resize also copies the old contents over to the new, shrinked buffer (at least as much as possible)? Doesn’t seem necessary to me when the buffer will be overwritten with the contents of the next message anyways.