forked from dotnet/MQTTnet
-
Notifications
You must be signed in to change notification settings - Fork 0
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.
- Loading branch information
Showing
6 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
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 dropped) | ||
{ | ||
SenderClientId = senderClientId ?? throw new ArgumentNullException( nameof(senderClientId)); | ||
ReceiverClientId = receiverClientId ?? throw new ArgumentNullException(nameof(receiverClientId)); | ||
DroppedQueueFull = dropped; | ||
ApplicationMessage = applicationMessage ?? throw new ArgumentNullException(nameof(applicationMessage)); | ||
} | ||
public string SenderClientId { get; } | ||
|
||
public string ReceiverClientId { get; } | ||
|
||
public bool DroppedQueueFull { get; } | ||
|
||
|
||
public MqttApplicationMessage ApplicationMessage { get; } | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
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,18 @@ | ||
// 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 QueueMessageOverwrittenEventArgs : EventArgs | ||
{ | ||
public QueueMessageOverwrittenEventArgs(string receiverClientId) | ||
{ | ||
ReceiverClientId = receiverClientId ?? throw new ArgumentNullException(nameof(receiverClientId)); | ||
} | ||
|
||
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
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