CommunicationObject Class
Microsoft Silverlight will reach end of support after October 2021. Learn more.
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.
Inheritance Hierarchy
System.Object
System.ServiceModel.Channels.CommunicationObject
System.ServiceModel.ChannelFactory
System.ServiceModel.Channels.ChannelBase
System.ServiceModel.Channels.ChannelManagerBase
Namespace: System.ServiceModel.Channels
Assembly: System.ServiceModel (in System.ServiceModel.dll)
Syntax
'Declaration
Public MustInherit Class CommunicationObject _
Implements ICommunicationObject
public abstract class CommunicationObject : ICommunicationObject
The CommunicationObject type exposes the following members.
Constructors
Name | Description | |
---|---|---|
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. |
Top
Properties
Name | Description | |
---|---|---|
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. |
Top
Methods
Name | Description | |
---|---|---|
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 close a communication object. | |
BeginOpen(TimeSpan, AsyncCallback, Object) | Begins an asynchronous operation to close 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 | Completes an asynchronous operation to close a communication object. | |
EndOpen | 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. | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
GetCommunicationObjectType | Gets the type of communication object. | |
GetHashCode | Serves as a hash function for a particular type. (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 | When 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. | |
OnBeginClose | When 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. | |
OnBeginOpen | When 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. | |
OnClose | When 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. | |
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 | When implemented in a derived class, completes an asynchronous operation on the close of a communication object. | |
OnEndOpen | When implemented in a derived class, 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 | When 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. | |
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.) |
Top
Events
Name | Description | |
---|---|---|
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. |
Top
Remarks
The CommunicationObject class implements the ICommunicationObject interface for all communication objects inSilverlight 5. 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 Silverlight 5 is the same as the state machine implemented for communication-oriented objects in Windows Communication Foundation (WCF). For a discussion of states and transitions between states, see Understanding State Changes
Version Information
Silverlight
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
XNA Framework
Supported in: Windows Phone OS 7.0
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.