diff --git a/Lidgren.Network/NetPeer.cs b/Lidgren.Network/NetPeer.cs
index 3e59e2b..bfb32f5 100644
--- a/Lidgren.Network/NetPeer.cs
+++ b/Lidgren.Network/NetPeer.cs
@@ -180,15 +180,24 @@ namespace Lidgren.Network
///
/// Read a pending message from any connection, blocking up to maxMillis if needed
///
- public NetIncomingMessage WaitMessage(int maxMillis)
- {
- var msg = ReadMessage();
- if (msg != null)
- return msg; // no need to wait; we already have a message to deliver
- var msgEvt = MessageReceivedEvent;
- msgEvt.WaitOne(maxMillis);
- return ReadMessage();
- }
+ public NetIncomingMessage WaitMessage(int maxMillis)
+ {
+ NetIncomingMessage msg = ReadMessage();
+
+ while (msg == null)
+ {
+ // This could return true...
+ if (!MessageReceivedEvent.WaitOne(maxMillis))
+ {
+ return null;
+ }
+
+ // ... while this will still returns null. That's why we need to cycle.
+ msg = ReadMessage();
+ }
+
+ return msg;
+ }
///
/// Read a pending message from any connection, if any