MessageEnumerator.RemoveCurrent Method (TimeSpan, MessageQueueTransaction)
Removes the current message from a transactional queue and returns the message to the calling application. If there is a message to remove, the method returns it immediately. Otherwise, the method waits the specified timeout for a new message to arrive.
Assembly: System.Messaging (in System.Messaging.dll)
public Message RemoveCurrent( TimeSpan timeout, MessageQueueTransaction transaction )
- Type: System.TimeSpan
The interval of time to wait for the message to be removed.
RemoveCurrent removes and returns the message at the cursor's current location. If the cursor is at the end of the queue, this overload of the method waits until a message is available or the interval specified by the timeout parameter has expired.
When working with transactional queues, a rollback of a transaction causes any messages removed by a call to RemoveCurrent to be returned to the queue. The removal is not irreversible until the transaction is committed.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.