-
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
Optimize SendPacketAsync method for MQTTnet.AspNetCore #1582
Conversation
xljiulang
commented
Nov 24, 2022
- Avoid to call MqttPacketBuffer.Join() when SendPacketAsync
- Safely cleanup the PacketFormatterAdapter
@chkr1011 |
var feature = connection.Features.Get<IHttpContextFeature>(); | ||
if (feature != null) | ||
{ | ||
_isOverWebSocket = feature.HttpContext.WebSockets.IsWebSocketRequest; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just out of curiosity, there any chance that this will be not a web socket request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, MqttConnectionHandler
has two usage scenarios, UseMqtt
and MapMqtt
, for over tcp
and over WebSocket
.
Thank you for your contribution. Good work 👍 |