CommunicationObject CommunicationObject CommunicationObject CommunicationObject 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 ref class CommunicationObject abstract : System::ServiceModel::ICommunicationObject
public abstract class CommunicationObject : System.ServiceModel.ICommunicationObject
type CommunicationObject = class
    interface ICommunicationObject
Public MustInherit Class CommunicationObject
Implements ICommunicationObject
Inheritance
CommunicationObjectCommunicationObjectCommunicationObjectCommunicationObject
Derived
Implements

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

CommunicationObject() CommunicationObject() CommunicationObject() CommunicationObject()

Initializes a new instance of the CommunicationObject class.

CommunicationObject(Object) CommunicationObject(Object) CommunicationObject(Object) CommunicationObject(Object)

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

Properties

DefaultCloseTimeout DefaultCloseTimeout DefaultCloseTimeout DefaultCloseTimeout

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

DefaultOpenTimeout DefaultOpenTimeout DefaultOpenTimeout DefaultOpenTimeout

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

IsDisposed IsDisposed IsDisposed IsDisposed

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

State State State State

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

ThisLock ThisLock ThisLock ThisLock

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

Methods

Abort() Abort() Abort() Abort()

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

BeginClose(AsyncCallback, Object) BeginClose(AsyncCallback, Object) BeginClose(AsyncCallback, Object) BeginClose(AsyncCallback, Object)

Begins an asynchronous operation to close a communication object.

BeginClose(TimeSpan, AsyncCallback, Object) BeginClose(TimeSpan, AsyncCallback, Object) BeginClose(TimeSpan, AsyncCallback, Object) BeginClose(TimeSpan, AsyncCallback, Object)

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

BeginOpen(AsyncCallback, Object) BeginOpen(AsyncCallback, Object) BeginOpen(AsyncCallback, Object) BeginOpen(AsyncCallback, Object)

Begins an asynchronous operation to open a communication object.

BeginOpen(TimeSpan, AsyncCallback, Object) BeginOpen(TimeSpan, AsyncCallback, Object) BeginOpen(TimeSpan, AsyncCallback, Object) BeginOpen(TimeSpan, AsyncCallback, Object)

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

Close() Close() Close() Close()

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

Close(TimeSpan) Close(TimeSpan) Close(TimeSpan) Close(TimeSpan)

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

EndClose(IAsyncResult) EndClose(IAsyncResult) EndClose(IAsyncResult) EndClose(IAsyncResult)

Completes an asynchronous operation to close a communication object.

EndOpen(IAsyncResult) EndOpen(IAsyncResult) EndOpen(IAsyncResult) EndOpen(IAsyncResult)

Completes an asynchronous operation to open a communication object.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Fault() Fault() Fault() Fault()

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

GetCommunicationObjectType() GetCommunicationObjectType() GetCommunicationObjectType() GetCommunicationObjectType()

Gets the type of communication object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnAbort() OnAbort() OnAbort() OnAbort()

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

OnBeginClose(TimeSpan, AsyncCallback, Object) OnBeginClose(TimeSpan, AsyncCallback, Object) OnBeginClose(TimeSpan, AsyncCallback, Object) OnBeginClose(TimeSpan, AsyncCallback, Object)

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

OnBeginOpen(TimeSpan, AsyncCallback, Object) OnBeginOpen(TimeSpan, AsyncCallback, Object) OnBeginOpen(TimeSpan, AsyncCallback, Object) OnBeginOpen(TimeSpan, AsyncCallback, Object)

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

OnClose(TimeSpan) OnClose(TimeSpan) OnClose(TimeSpan) OnClose(TimeSpan)

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

OnClosed() OnClosed() OnClosed() OnClosed()

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

OnClosing() OnClosing() OnClosing() OnClosing()

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

OnEndClose(IAsyncResult) OnEndClose(IAsyncResult) OnEndClose(IAsyncResult) OnEndClose(IAsyncResult)

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

OnEndOpen(IAsyncResult) OnEndOpen(IAsyncResult) OnEndOpen(IAsyncResult) OnEndOpen(IAsyncResult)

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

OnFaulted() OnFaulted() OnFaulted() OnFaulted()

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

OnOpen(TimeSpan) OnOpen(TimeSpan) OnOpen(TimeSpan) OnOpen(TimeSpan)

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

OnOpened() OnOpened() OnOpened() OnOpened()

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

OnOpening() OnOpening() OnOpening() OnOpening()

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

Open() Open() Open() Open()

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

Open(TimeSpan) Open(TimeSpan) Open(TimeSpan) Open(TimeSpan)

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

ThrowIfDisposed() ThrowIfDisposed() ThrowIfDisposed() ThrowIfDisposed()

Throws an exception if the communication object is disposed.

ThrowIfDisposedOrImmutable() ThrowIfDisposedOrImmutable() ThrowIfDisposedOrImmutable() ThrowIfDisposedOrImmutable()

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

ThrowIfDisposedOrNotOpen() ThrowIfDisposedOrNotOpen() ThrowIfDisposedOrNotOpen() ThrowIfDisposedOrNotOpen()

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

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Events

Closed Closed Closed Closed

Occurs when a communication object transitions into the closed state.

Closing Closing Closing Closing

Occurs when a communication object transitions into the closing state.

Faulted Faulted Faulted Faulted

Occurs when a communication object transitions into the faulted state.

Opened Opened Opened Opened

Occurs when a communication object transitions into the opened state.

Opening Opening Opening Opening

Occurs when a communication object transitions into the opening state.

Applies to