CommunicationObject Class
TOC
Collapse the table of content
Expand the table of content

CommunicationObject Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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

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

public abstract class CommunicationObject : ICommunicationObject

The CommunicationObject type exposes the following members.

  NameDescription
Protected methodCommunicationObject()Initializes a new instance of the CommunicationObject class.
Protected methodCommunicationObject(Object)Initializes a new instance of the CommunicationObject class with the mutually exclusive lock to protect the state transitions specified.
Top

  NameDescription
Protected propertyDefaultCloseTimeoutWhen overridden in a derived class, gets the default interval of time provided for a close operation to complete.
Protected propertyDefaultOpenTimeoutWhen overridden in a derived class, gets the default interval of time provided for an open operation to complete.
Protected propertyIsDisposedGets a value that indicates whether the communication object has been disposed.
Public propertyStateGets a value that indicates the current state of the communication object.
Protected propertyThisLockGets the mutually exclusive lock that protects the class instance during a state transition.
Top

  NameDescription
Public methodAbortCauses a communication object to transition immediately from its current state into the closing state.
Public methodBeginClose(AsyncCallback, Object)Begins an asynchronous operation to close a communication object.
Public methodBeginClose(TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to close a communication object with a specified timeout.
Public methodBeginOpen(AsyncCallback, Object)Begins an asynchronous operation to close a communication object.
Public methodBeginOpen(TimeSpan, AsyncCallback, Object)Begins an asynchronous operation to close a communication object within a specified interval of time.
Public methodClose()Causes a communication object to transition from its current state into the closed state.
Public methodClose(TimeSpan)Causes a communication object to transition from its current state into the closed state within a specified interval of time.
Public methodEndCloseCompletes an asynchronous operation to close a communication object.
Public methodEndOpenCompletes an asynchronous operation to open a communication object.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFaultCauses a communication object to transition from its current state into the faulted state.
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Protected methodGetCommunicationObjectTypeGets the type of communication object.
Public methodGetHashCodeServes as a hash function for a particular type. (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 methodOnAbortWhen implemented in a derived class, inserts processing on a communication object after it transitions to the closing state due to the invocation of a synchronous abort operation.
Protected methodOnBeginCloseWhen implemented in a derived class, inserts processing after a communication object transitions to the closing state due to the invocation of an asynchronous close operation.
Protected methodOnBeginOpenWhen implemented in a derived class, inserts processing on a communication object after it transitions to the opening state due to the invocation of an asynchronous open operation.
Protected methodOnCloseWhen implemented in a derived class, inserts processing on a communication object after it transitions to the closing state due to the invocation of a synchronous close operation.
Protected methodOnClosedInvoked during the transition of a communication object into the closing state.
Protected methodOnClosingInvoked during the transition of a communication object into the closing state.
Protected methodOnEndCloseWhen implemented in a derived class, completes an asynchronous operation on the close of a communication object.
Protected methodOnEndOpenWhen implemented in a derived class, completes an asynchronous operation on the open of a communication object.
Protected methodOnFaultedInserts processing on a communication object after it transitions to the faulted state due to the invocation of a synchronous fault operation.
Protected methodOnOpenWhen implemented in a derived class, inserts processing on a communication object after it transitions into the opening state which must complete within a specified interval of time.
Protected methodOnOpenedInvoked during the transition of a communication object into the opened state.
Protected methodOnOpeningInvoked during the transition of a communication object into the opening state.
Public methodOpen()Causes a communication object to transition from the created state into the opened state.
Public methodOpen(TimeSpan)Causes a communication object to transition from the created state into the opened state within a specified interval of time.
Protected methodThrowIfDisposedThrows an exception if the communication object is disposed.
Protected methodThrowIfDisposedOrImmutableThrows an exception if the communication object the State property is not set to the Created state.
Protected methodThrowIfDisposedOrNotOpenThrows an exception if the communication object is not in the Opened state.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public eventClosedOccurs when a communication object transitions into the closed state.
Public eventClosingOccurs when a communication object transitions into the closing state.
Public eventFaultedOccurs when a communication object transitions into the faulted state.
Public eventOpenedOccurs when a communication object transitions into the opened state.
Public eventOpeningOccurs when a communication object transitions into the opening state.
Top

The CommunicationObject class implements the ICommunicationObject interface for all communication objects in Windows Phone. 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.

The state machine implemented for communication-oriented objects in Windows Phone is the same as the state machine implemented for communication-oriented objects in Windows Communication Foundation (WCF). For a discussion of how to test states and transitions between states, see How to test app state changes for Windows Phone 8.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Show:
© 2017 Microsoft