MessageQueue.Peek Method

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a copy of the first message in the queue without removing the message from the queue.

Namespace:   System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

NameDescription
System_CAPS_pubmethodPeek()

Returns without removing (peeks) the first message in the queue referenced by this MessageQueue. The Peek method is synchronous, so it blocks the current thread until a message becomes available.

System_CAPS_pubmethodPeek(TimeSpan)

Returns without removing (peeks) the first message in the queue referenced by this MessageQueue. The Peek method is synchronous, so it blocks the current thread until a message becomes available or the specified time-out occurs.

System_CAPS_pubmethodPeek(TimeSpan, Cursor, PeekAction)

Returns without removing (peeks) the current or next message in the queue, using the specified cursor. The Peek method is synchronous, so it blocks the current thread until a message becomes available or the specified time-out occurs.

The method is not thread safe.

Return to top
Show: