in src/main/csharp/Readers/BySelectorMessageReader.cs [184:222]
private IMessage InternalPeek(DateTime maxTime, bool convertBody)
{
TimeSpan timeSpan = maxTime - DateTime.Now;
if(timeSpan <= TimeSpan.Zero)
{
timeSpan = TimeSpan.Zero;
}
using(Cursor cursor = messageQueue.CreateCursor())
{
PeekAction action = PeekAction.Current;
while(true)
{
Message msmqMessage = null;
try
{
msmqMessage = messageQueue.Peek(timeSpan, cursor, action);
}
catch(MessageQueueException exc)
{
if(exc.MessageQueueErrorCode == MessageQueueErrorCode.IOTimeout)
{
return null;
}
throw exc;
}
IMessage nmsMessage = InternalMatch(msmqMessage, convertBody);
if(nmsMessage != null)
{
return nmsMessage;
}
action = PeekAction.Next;
}
}
}