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 ///