Επεξεργασία

Κοινή χρήση μέσω


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
CommunicationObject
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()

Initializes a new instance of the CommunicationObject class.

CommunicationObject(Object)

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

Properties

DefaultCloseTimeout

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

DefaultOpenTimeout

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

IsDisposed

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.

ThisLock

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.

BeginClose(AsyncCallback, Object)

Begins an asynchronous operation to close a communication object.

BeginClose(TimeSpan, AsyncCallback, Object)

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

BeginOpen(AsyncCallback, Object)

Begins an asynchronous operation to open a communication object.

BeginOpen(TimeSpan, AsyncCallback, 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(TimeSpan)

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

EndClose(IAsyncResult)

Completes an asynchronous operation to close a communication object.

EndOpen(IAsyncResult)

Completes an asynchronous operation to open a communication object.

Equals(Object)

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

(Inherited from Object)
Fault()

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

GetCommunicationObjectType()

Gets the type of communication object.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
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)

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

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)

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

OnClosed()

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

OnClosing()

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

OnEndClose(IAsyncResult)

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

OnEndOpen(IAsyncResult)

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

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)

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

OnOpened()

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

OnOpening()

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(TimeSpan)

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

ThrowIfDisposed()

Throws an exception if the communication object is disposed.

ThrowIfDisposedOrImmutable()

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

ThrowIfDisposedOrNotOpen()

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

ToString()

Returns a string that represents the current object.

(Inherited from Object)

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.

Applies to