ReceiveContext Class

Derive from this class to implement a custom state machine for receive context functionality.

System.Object
  System.ServiceModel.Channels.ReceiveContext

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public abstract class ReceiveContext

The ReceiveContext type exposes the following members.

  NameDescription
Protected methodReceiveContextInitializes a new instance of the ReceiveContext class.
Top

  NameDescription
Public propertyStateGets or sets the state of the state machine.
Protected propertyThisLockAn object used for locking the ReceiveContext instance.
Top

  NameDescription
Public methodAbandon(TimeSpan)Causes the state machine to transition to the abandoned state with the specified timeout value.
Public methodAbandon(Exception, TimeSpan)Causes the state machine to transition to the abandoned state with the specified exception and timeout value.
Public methodBeginAbandon(TimeSpan, AsyncCallback, Object)Begins an asynchronous abandon operation with the specified timeout, asynchronous callback, and user-defined state data.
Public methodBeginAbandon(Exception, TimeSpan, AsyncCallback, Object)Begins an asynchronous abandon operation with the specified exception, timeout, asynchronous callback, and user-defined state data.
Public methodBeginCompleteBegins an asynchronous complete operation with the specified timeout, asynchronous callback, and user-defined state data.
Public methodCompleteCauses the state machine to transition to the completed state with the specified timeout value.
Public methodEndAbandonCompletes an asynchronous abandon operation.
Public methodEndCompleteCompletes an asynchronous complete operation.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFaultCauses the state machine to transition to the faulted state.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Protected methodOnAbandon(TimeSpan)Called when the state machine is transitioning to the abandoned state with the specified timeout value.
Protected methodOnAbandon(Exception, TimeSpan)Called when the state machine is transitioning to the abandoned state with the specified exception and timeout value.
Protected methodOnBeginAbandon(TimeSpan, AsyncCallback, Object)Called when the state machine is transitioning to the abandoned state asynchronously with the specified timeout value, callback, and state data.
Protected methodOnBeginAbandon(Exception, TimeSpan, AsyncCallback, Object)Called when the state machine is transitioning to the abandoned state asynchronously with the specified exception, timeout value, callback, and state data.
Protected methodOnBeginCompleteCalled when the state machine is transitioning to the completed state asynchronously with the specified timeout, callback, and state data.
Protected methodOnCompleteCalled when the state machine is transitioning to the completed state with the specified timeout value.
Protected methodOnEndAbandonCalled when the state machine is transitioning to the abandoned state asynchronously.
Protected methodOnEndCompleteCalled when the state machine is transitioning to the completed state asynchronously.
Protected methodOnFaultedCalled when the state machine is transitioning to the faulted state.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodStatic memberTryGet(Message, ReceiveContext)Attempts to get the receive context from the specified message.
Public methodStatic memberTryGet(MessageProperties, ReceiveContext)Attempts to get the receive context from the specified message properties collection.
Top

  NameDescription
Public eventFaultedDefines the event to raised when an exception has occurred during the messaging process.
Top

  NameDescription
Public fieldStatic memberNameThe name of the receive context.
Top

Receive context functionality is two-fold. When working with a queued channel, receive context allows you to lock a message prior to processing it. If a failure occurs, the message remains locked so that the service that is processing the message maintains ownership (another service cannot receive and process the same message) and may choose to perform some other action on it. When working with a one-way channel, receive context allows a service to control when it sends an acknowledgement message or it can indicate a problem by sending a negative acknowledgement message. The client can then choose to resend the message if it receives a negative acknowledgement or if it does not receive an acknowledgement within a certain period of time.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4

.NET Framework Client Profile

Supported in: 4

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.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft