-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds events for delivered and dropped messages. (#1866)
* Adds events for delivered and dropped messages. * Rename new events to match other namings * Update ReleaseNotes.md --------- Co-authored-by: Christian <[email protected]>
- Loading branch information
Showing
9 changed files
with
104 additions
and
7 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
* [Client] Added support for custom CA chain validation (#1851, thanks to @rido-min). | ||
* [Client] Added support for custom CA chain validation (#1851, thanks to @rido-min). | ||
* [Client] Fixed handling of unobserved tasks exceptions (#1871). | ||
* [Client] Fixed not specified ReasonCode when using _SendExtendedAuthenticationExchangeDataAsync_ (#1882, thanks to @rido-min). | ||
* [Server] Fixed not working _UpdateRetainedMessageAsync_ public api (#1858, thanks to @kimdiego2098). | ||
* [Server] Added support for custom DISCONNECT packets when stopping the server or disconnect a client (BREAKING CHANGE!, #1846). | ||
* [Server] Added new property to stop the server from accepting new connections even if it is running (#1846). | ||
* [Server] Added new events for delivered and dropped messages (#1866, thanks to @kallayj). |
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
27 changes: 27 additions & 0 deletions
27
Source/MQTTnet/Server/Events/ApplicationMessageEnqueuedEventArgs.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
|
||
namespace MQTTnet.Server | ||
{ | ||
public sealed class ApplicationMessageEnqueuedEventArgs : EventArgs | ||
{ | ||
public ApplicationMessageEnqueuedEventArgs(string senderClientId, string receiverClientId, MqttApplicationMessage applicationMessage, bool isDropped) | ||
{ | ||
SenderClientId = senderClientId ?? throw new ArgumentNullException( nameof(senderClientId)); | ||
ReceiverClientId = receiverClientId ?? throw new ArgumentNullException(nameof(receiverClientId)); | ||
ApplicationMessage = applicationMessage ?? throw new ArgumentNullException(nameof(applicationMessage)); | ||
IsDropped = isDropped; | ||
} | ||
|
||
public string SenderClientId { get; } | ||
|
||
public string ReceiverClientId { get; } | ||
|
||
public bool IsDropped { get; } | ||
|
||
public MqttApplicationMessage ApplicationMessage { get; } | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
Source/MQTTnet/Server/Events/QueueMessageOverwrittenEventArgs.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using MQTTnet.Packets; | ||
|
||
namespace MQTTnet.Server | ||
{ | ||
public sealed class QueueMessageOverwrittenEventArgs : EventArgs | ||
{ | ||
public QueueMessageOverwrittenEventArgs(string receiverClientId, MqttPacket packet) | ||
{ | ||
ReceiverClientId = receiverClientId ?? throw new ArgumentNullException(nameof(receiverClientId)); | ||
Packet = packet ?? throw new ArgumentNullException(nameof(packet)); | ||
} | ||
|
||
public MqttPacket Packet { get; } | ||
|
||
public string ReceiverClientId { get; } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
namespace MQTTnet.Server | ||
{ | ||
public enum EnqueueDataPacketResult | ||
{ | ||
Enqueued, | ||
Dropped | ||
} | ||
} |
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
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
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
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