Skip to content

Commit

Permalink
If there is no destination (i.e. CommandType.Done), just skip it.
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Matthey committed May 16, 2024
1 parent a7d8429 commit 7f9fb67
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/NetMQ/Core/IOThread.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public void Ready()
// Process all available commands.
while (m_mailbox.TryRecv(out Command command))
{
Assumes.NotNull(command.Destination);
command.Destination.ProcessCommand(command);
command.Destination?.ProcessCommand(command);
}
}

Expand Down
4 changes: 1 addition & 3 deletions src/NetMQ/Core/Reaper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,8 @@ 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);
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/NetMQ/Core/SocketBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,8 +1261,7 @@ private void ProcessCommands(int timeout, bool throttle, CancellationToken cance
// Process all the commands available at the moment.
while (found)
{
Assumes.NotNull(command.Destination);
command.Destination.ProcessCommand(command);
command.Destination?.ProcessCommand(command);
found = m_mailbox.TryRecv(0, out command);
}

Expand Down

0 comments on commit 7f9fb67

Please sign in to comment.