System.ServiceModel 4.0.0.0 System.Enum

This enumeration defines the states that are valid for all communication objects in the system, including channels, listeners, factories, dispatchers, and service hosts.

The methods that manage transitions between these states and the events that can be associated with them are defined in the interface. The state of an object can be obtained using the property.

There are four main states and two transient states that a communication object can occupy. The main states are:

The two transitory states that a communication object can occupy when transitioning between these main states are:

The communication object can be configured in the state. For example, its properties can be changed, and its events can be registered. No input or output can occur in this state. So messages, for example, cannot be sent or received from a channel in this state.

The is a temporary state that the communication object enters when the method is invoked. Unless otherwise noted on derived classes, objects in the opening state cannot be configured. This transition state can only be entered from the state.

Objects transition to the state when the open process completes. This transition to the state is only valid from the state. Unless otherwise noted on derived classes, the configuration of the object is now disabled. At this point, the object is fully usable for message transfers.

The is a temporary state that the object enters when the method is invoked for a graceful shutdown or the object is aborted. At this point, the object becomes (if not already) unusable. This transition is valid from any state except the state.

The state is equivalent to being disposed and the configuration of the object can still be inspected.

The state is used to indicate that the object has transitioned to a state where it can no longer be used. There are two primary scenarios where this can happen:

If the method fails for any reason, the object transitions to the faulted state.

If a session-based channel detects an error that it cannot recover from, it transitions to the faulted state. This can happen for instance if there is a protocol error (that is, it receives a protocol message at an invalid time) or if the remote endpoint aborts the session.

An object in the state is not closed and may be holding resources. The method should be used to close an object that has faulted. If is called on an object in the state, a is thrown because the object cannot be gracefully closed.

Defines the states in which an can exist.

- Field
  4.0.0.0
  System.ServiceModel.CommunicationState

  Indicates that the communication object has been closed and is no longer usable.

- Field
  4.0.0.0
  System.ServiceModel.CommunicationState

  Indicates that the communication object is transitioning to the state.

- Field
  4.0.0.0
  System.ServiceModel.CommunicationState

  Indicates that the communication object has been instantiated and is configurable, but not yet open or ready for use.

- Field
  4.0.0.0
  System.ServiceModel.CommunicationState

  Indicates that the communication object has encountered an error or fault from which it cannot recover and from which it is no longer usable.

- Field
  4.0.0.0
  System.ServiceModel.CommunicationState

  Indicates that the communication object is now open and ready to be used.

- Field
  4.0.0.0
  System.ServiceModel.CommunicationState

  Indicates that the communication object is being transitioned from the state to the state.