question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support streams when sending and/or receiving

See original GitHub issue

Describe 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:open
  • Created 3 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mg90707commented, Jan 26, 2021

@ramonsmits I think it would have to be a ReadOnlyMemory<Byte> as a Spans can only exists on the Stack, not the Heap.

0reactions
mg90707commented, Feb 5, 2021

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found