System.Messaging Reference (Document! X Sample)
BeginPeek(TimeSpan) Method



System.Messaging Namespace > MessageQueue Class > BeginPeek Method : BeginPeek(TimeSpan) Method
A System.TimeSpan that indicates the interval of time to wait for a message to become available.
Initiates an asynchronous peek operation that has a specified time-out. The operation is not complete until either a message becomes available in the queue or the time-out occurs.
Syntax
'Declaration
 
Public Overloads Function BeginPeek( _
   ByVal timeout As TimeSpan _
) As IAsyncResult
'Usage
 
Dim instance As MessageQueue
Dim timeout As TimeSpan
Dim value As IAsyncResult
 
value = instance.BeginPeek(timeout)
public IAsyncResult BeginPeek( 
   TimeSpan timeout
)
public:
IAsyncResult^ BeginPeek( 
   TimeSpan timeout
) 

Parameters

timeout
A System.TimeSpan that indicates the interval of time to wait for a message to become available.

Return Value

The System.IAsyncResult that identifies the posted asynchronous request.
Exceptions
ExceptionDescription
The value specified for the timeout parameter is not valid.
An error occurred when accessing a Message Queuing method.
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

Reference

MessageQueue Class
MessageQueue Members
Overload List