NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

MessageQueue.BeginReceive ()

Receives the first message available in the queue referenced by the MessageQueue.

[Visual Basic]
Overloads Public Function BeginReceive() As IAsyncResult
[C#]
public IAsyncResult BeginReceive();
[C++]
public: IAsyncResult* BeginReceive();
[JScript]
public function BeginReceive() : IAsyncResult;

Return Value

The IAsyncResult that identifies the asynchronous request posted.

Remarks

BeginReceive is used in asynchronous processing to raise the System.Messaging.MessageQueue.MessageQueue.ReceiveCompleted event when a message is removed from the queue. This overload does not specify a timeout, so System.Messaging.MessageQueue.ReceiveCompleted will only be raised when a message has been removed.

Because BeginReceive is asynchronous, you can use this method to peek the queue without blocking the current thread of execution. To peek the queue synchronously, use the Receive method.

See Also

MessageQueue Class | MessageQueue Members | System.Messaging Namespace | MessageQueue.BeginReceive Overload List | EndReceive | BeginPeek | Receive | Peek