mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-17 01:33:03 +08:00
Fix RPC issue #1093 by calling both message handlers.
This commit is contained in:
@@ -18,14 +18,15 @@ namespace MQTTnet.Extensions.Rpc
|
||||
|
||||
public IMqttApplicationMessageReceivedHandler OriginalHandler { get; }
|
||||
|
||||
public Task HandleApplicationMessageReceivedAsync(MqttApplicationMessageReceivedEventArgs eventArgs)
|
||||
public async Task HandleApplicationMessageReceivedAsync(MqttApplicationMessageReceivedEventArgs eventArgs)
|
||||
{
|
||||
// First try to check if there is a pending RPC call!
|
||||
await _handleReceivedApplicationMessageAsync(eventArgs).ConfigureAwait(false);
|
||||
|
||||
if (OriginalHandler != null)
|
||||
{
|
||||
return OriginalHandler.HandleApplicationMessageReceivedAsync(eventArgs);
|
||||
await OriginalHandler.HandleApplicationMessageReceivedAsync(eventArgs).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
return _handleReceivedApplicationMessageAsync(eventArgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user