Skip to content

Commit ad997b0

Browse files
committed
TryRead can potential send back false if something when wrong in the mean while.
1 parent 47bdc29 commit ad997b0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/NetMQ/Core/Mailbox.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,9 @@ public bool TryRecv(int timeout, out Command command)
229229
return false;
230230
}
231231

232-
// We've got the signal. Now we can switch into active state.
233-
m_active = true;
234-
235-
// Get a command.
236-
var ok = m_commandPipe.TryRead(out command);
237-
Debug.Assert(ok);
238-
return ok;
232+
// We've got the signal. Now we can switch into active state if we can read.
233+
m_active = m_commandPipe.TryRead(out command);
234+
return m_active;
239235
}
240236

241237
/// <summary>

0 commit comments

Comments
 (0)