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;
The IAsyncResult that identifies the asynchronous request posted.
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.
MessageQueue Class | MessageQueue Members | System.Messaging Namespace | MessageQueue.BeginReceive Overload List | EndReceive | BeginPeek | Receive | Peek