ICommunicationObject ICommunicationObject ICommunicationObject ICommunicationObject Interface

定义

为系统中所有面向通信的对象(包括通道、通道管理器、工厂、侦听器以及调度程序和服务主机)定义基本状态机的协定。Defines the contract for the basic state machine for all communication-oriented objects in the system, including channels, the channel managers, factories, listeners, and dispatchers, and service hosts.

public interface class ICommunicationObject
public interface ICommunicationObject
type ICommunicationObject = interface
Public Interface ICommunicationObject
派生

注解

ICommunicationObject 接口定义:The ICommunicationObject interface defines:

  • 一组用于启动状态转换的打开、关闭和中止方法:A set of open, close and abort methods for initiating state transitions:

  • 打开和关闭方法的异步版本:Asynchronous versions of the open and close methods:

  • 一组提供状态转换通知的事件:A set of events that provide notifications of state transitions:

  • 一个用于检查对象状态的公共 State 属性A common State property for inspecting the state of an object

属性

State State State State

获取面向通信的对象的当前状态。Gets the current state of the communication-oriented object.

方法

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

使通信对象立即从其当前状态转换到关闭状态。Causes a communication object to transition immediately from its current state into the closed 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.

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.

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.

事件

Closed Closed Closed Closed

当通信对象完成从正在关闭状态转换到已关闭状态时发生。Occurs when the communication object completes its transition from the closing state into the closed state.

Closing Closing Closing Closing

当通信对象首次进入正在关闭状态时发生。Occurs when the communication object first enters the closing state.

Faulted Faulted Faulted Faulted

当通信对象首次进入出错状态时发生。Occurs when the communication object first enters the faulted state.

Opened Opened Opened Opened

当通信对象完成从正在打开状态转换到已打开状态时发生。Occurs when the communication object completes its transition from the opening state into the opened state.

Opening Opening Opening Opening

当通信对象首次进入正在打开状态时发生。Occurs when the communication object first enters the opening state.

适用于