From f589208841948994025501eb97cc9282f2dc2c71 Mon Sep 17 00:00:00 2001 From: lidgren Date: Sat, 30 Oct 2010 19:55:38 +0000 Subject: [PATCH] WaitMessage readded (again) --- Lidgren.Network/NetPeer.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Lidgren.Network/NetPeer.cs b/Lidgren.Network/NetPeer.cs index 2f71bb5..7c7ba69 100644 --- a/Lidgren.Network/NetPeer.cs +++ b/Lidgren.Network/NetPeer.cs @@ -129,6 +129,16 @@ namespace Lidgren.Network return retval; } + /// + /// Read a pending message from any connection, blocking up to maxMillis if needed + /// + public NetIncomingMessage WaitMessage(int maxMillis) + { + if (m_messageReceivedEvent != null) + m_messageReceivedEvent.WaitOne(maxMillis); + return ReadMessage(); + } + /// /// Read a pending message from any connection, if any ///