ICommunicationObject 介面

定義

定義系統中所有通訊導向物件 (包括通道、通道管理員、處理站、接聽程式、發送器和服務主機) 的基本狀態機器合約。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

取得通訊導向物件的目前狀態。Gets the current state of the communication-oriented object.

方法

Abort()

導致通訊物件立即從目前的狀態轉換為已關閉狀態。Causes a communication object to transition immediately from its current state into the closed 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.

EndClose(IAsyncResult)

完成非同步作業以關閉通訊物件。Completes an asynchronous operation to close a communication object.

EndOpen(IAsyncResult)

完成非同步作業以開啟通訊物件。Completes an asynchronous operation to open a communication object.

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.

事件

Closed

當通訊物件從關閉中狀態轉換為已關閉狀態完成時發生。Occurs when the communication object completes its transition from the closing state into the closed state.

Closing

當通訊物件第一次進入關閉中狀態時發生。Occurs when the communication object first enters the closing state.

Faulted

當通訊物件第一次進入錯誤狀態時發生。Occurs when the communication object first enters the faulted state.

Opened

當通訊物件從開啟中狀態轉換為已開啟狀態結束時發生。Occurs when the communication object completes its transition from the opening state into the opened state.

Opening

當通訊物件第一次進入開啟中狀態時發生。Occurs when the communication object first enters the opening state.

適用於