From 47b422d8598360f8abf741e5fc301553be578feb Mon Sep 17 00:00:00 2001 From: Thierry Matthey Date: Fri, 24 May 2024 13:23:27 +0200 Subject: [PATCH] Revert "If there is no destination (i.e. CommandType.Done), just skip it." This reverts commit 7f9fb67890bf63b072b21c9701ed262c2ea04267. --- src/NetMQ/Core/IOThread.cs | 3 ++- src/NetMQ/Core/Reaper.cs | 4 +++- src/NetMQ/Core/SocketBase.cs | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/NetMQ/Core/IOThread.cs b/src/NetMQ/Core/IOThread.cs index 261f995a6..9f3e04f92 100644 --- a/src/NetMQ/Core/IOThread.cs +++ b/src/NetMQ/Core/IOThread.cs @@ -91,7 +91,8 @@ public void Ready() // Process all available commands. while (m_mailbox.TryRecv(out Command command)) { - command.Destination?.ProcessCommand(command); + Assumes.NotNull(command.Destination); + command.Destination.ProcessCommand(command); } } diff --git a/src/NetMQ/Core/Reaper.cs b/src/NetMQ/Core/Reaper.cs index 8eb1b5627..d7853cb98 100644 --- a/src/NetMQ/Core/Reaper.cs +++ b/src/NetMQ/Core/Reaper.cs @@ -126,8 +126,10 @@ public void InEvent() if (!m_mailbox.TryRecv(0, out Command command)) break; + Assumes.NotNull(command.Destination); + // Process the command. - command.Destination?.ProcessCommand(command); + command.Destination.ProcessCommand(command); } } diff --git a/src/NetMQ/Core/SocketBase.cs b/src/NetMQ/Core/SocketBase.cs index fc20b24e8..cf7063212 100644 --- a/src/NetMQ/Core/SocketBase.cs +++ b/src/NetMQ/Core/SocketBase.cs @@ -1261,7 +1261,8 @@ private void ProcessCommands(int timeout, bool throttle, CancellationToken cance // Process all the commands available at the moment. while (found) { - command.Destination?.ProcessCommand(command); + Assumes.NotNull(command.Destination); + command.Destination.ProcessCommand(command); found = m_mailbox.TryRecv(0, out command); }