MoveNext(TimeSpan) Method
Advances the enumerator to the next message in the queue. If the enumerator is positioned at the end of the queue, MoveNext waits until a message is available or the given timeout expires.
Syntax
'Usage Dim instance As MessageEnumerator Dim timeout As TimeSpan Dim value As Boolean value = instance.MoveNext(timeout)
Parameters
- timeout
- The System.TimeSpan to wait for a message to be available if the enumerator is positioned at the end of the queue.
Return Value
true if the enumerator successfully advanced to the next message; false if the enumerator has reached the end of the queue and a message does not become available within the time specified by the timeout parameter.
Exceptions
Exception | Description |
---|---|
System.ArgumentException | The value specified for the timeout parameter is invalid. It might represent a negative number. |
MessageQueueException | An exception specific to Message Queuing was thrown.-or- The timeout has expired. |
Requirements
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
See Also