Skip to content

Commit

Permalink
TryRead can potential send back false if something when wrong in the …
Browse files Browse the repository at this point in the history
…mean while.
  • Loading branch information
Thierry Matthey committed Aug 2, 2024
1 parent 47bdc29 commit ad997b0
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/NetMQ/Core/Mailbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,9 @@ public bool TryRecv(int timeout, out Command command)
return false;
}

// We've got the signal. Now we can switch into active state.
m_active = true;

// Get a command.
var ok = m_commandPipe.TryRead(out command);
Debug.Assert(ok);
return ok;
// We've got the signal. Now we can switch into active state if we can read.
m_active = m_commandPipe.TryRead(out command);
return m_active;
}

/// <summary>
Expand Down

0 comments on commit ad997b0

Please sign in to comment.