Communication​Object Class

Definition

Provides a common base implementation for the basic state machine common to all communication-oriented objects in the system, including channels, listeners, and the channel and listener factories.

public abstract class CommunicationObject : System.ServiceModel.ICommunicationObject
Inheritance
CommunicationObject
Derived
Implements

Inherited Members

System.Object

Remarks

The CommunicationObject class implements the ICommunicationObject interface for all communication objects in Windows Communication Foundation (WCF). The method implementations handle parameter validation, raise events that notify the occurrence of state transitions, provide the means to associated additional processing with these state transitions, and ensure that such state changes are coordinated.

Constructors

Communication​Object()

Initializes a new instance of the CommunicationObject class.

Communication​Object(​Object)

Initializes a new instance of the CommunicationObject class with the mutually exclusive lock to protect the state transitions specified.

Properties

Default​Close​Timeout

When overridden in a derived class, gets the default interval of time provided for a close operation to complete.

Default​Open​Timeout

When overridden in a derived class, gets the default interval of time provided for an open operation to complete.

Is​Disposed

Gets a value that indicates whether the communication object has been disposed.

State

Gets a value that indicates the current state of the communication object.

This​Lock

Gets the mutually exclusive lock that protects the class instance during a state transition.

Methods

Abort()

Causes a communication object to transition immediately from its current state into the closing state.

Begin​Close(​Async​Callback, ​Object)

Begins an asynchronous operation to close a communication object.

Begin​Close(​Time​Span, ​Async​Callback, ​Object)

Begins an asynchronous operation to close a communication object with a specified timeout.

Begin​Open(​Async​Callback, ​Object)

Begins an asynchronous operation to open a communication object.

Begin​Open(​Time​Span, ​Async​Callback, ​Object)

Begins an asynchronous operation to open a communication object within a specified interval of time.

Close()

Causes a communication object to transition from its current state into the closed state.

Close(​Time​Span)

Causes a communication object to transition from its current state into the closed state within a specified interval of time.

End​Close(​IAsync​Result)

Completes an asynchronous operation to close a communication object.

End​Open(​IAsync​Result)

Completes an asynchronous operation to open a communication object.

Fault()

Causes a communication object to transition from its current state into the faulted state.

Get​Communication​Object​Type()

Gets the type of communication object.

On​Abort()

Inserts processing on a communication object after it transitions to the closing state due to the invocation of a synchronous abort operation.

On​Begin​Close(​Time​Span, ​Async​Callback, ​Object)

Inserts processing after a communication object transitions to the closing state due to the invocation of an asynchronous close operation.

On​Begin​Open(​Time​Span, ​Async​Callback, ​Object)

Inserts processing on a communication object after it transitions to the opening state due to the invocation of an asynchronous open operation.

On​Close(​Time​Span)

Inserts processing on a communication object after it transitions to the closing state due to the invocation of a synchronous close operation.

On​Closed()

Invoked during the transition of a communication object into the closing state.

On​Closing()

Invoked during the transition of a communication object into the closing state.

On​End​Close(​IAsync​Result)

Completes an asynchronous operation on the close of a communication object.

On​End​Open(​IAsync​Result)

Completes an asynchronous operation on the open of a communication object.

On​Faulted()

Inserts processing on a communication object after it transitions to the faulted state due to the invocation of a synchronous fault operation.

On​Open(​Time​Span)

Inserts processing on a communication object after it transitions into the opening state which must complete within a specified interval of time.

On​Opened()

Invoked during the transition of a communication object into the opened state.

On​Opening()

Invoked during the transition of a communication object into the opening state.

Open()

Causes a communication object to transition from the created state into the opened state.

Open(​Time​Span)

Causes a communication object to transition from the created state into the opened state within a specified interval of time.

Throw​If​Disposed()

Throws an exception if the communication object is disposed.

Throw​If​Disposed​Or​Immutable()

Throws an exception if the communication object the State property is not set to the Created state.

Throw​If​Disposed​Or​Not​Open()

Throws an exception if the communication object is not in the Opened state.

Events

Closed

Occurs when a communication object transitions into the closed state.

Closing

Occurs when a communication object transitions into the closing state.

Faulted

Occurs when a communication object transitions into the faulted state.

Opened

Occurs when a communication object transitions into the opened state.

Opening

Occurs when a communication object transitions into the opening state.