AnnouncementClient AnnouncementClient AnnouncementClient AnnouncementClient Class

定義

服務用於傳送探索公告訊息。Used by services to send discovery announcement messages. 用戶端可以使用探索機制,具體而言就是對應的 AnnouncementService 類別接聽和處理公告訊息。Clients can use the discovery mechanism, specifically the corresponding AnnouncementService class to listen and act on the announcement messages. 公告訊息包含有關服務的資訊,例如完整合約名稱、服務執行的任何範圍,以及服務要傳送的任何自訂中繼資料。An announcement message contains information about the service such as its fully-qualified contract name, any scopes that the service is operating in as well as any custom metadata the service wants to send.

public ref class AnnouncementClient sealed : IDisposable, System::ServiceModel::ICommunicationObject
public sealed class AnnouncementClient : IDisposable, System.ServiceModel.ICommunicationObject
type AnnouncementClient = class
    interface ICommunicationObject
    interface IDisposable
Public NotInheritable Class AnnouncementClient
Implements ICommunicationObject, IDisposable
繼承
AnnouncementClientAnnouncementClientAnnouncementClientAnnouncementClient
實作

備註

如果服務加入 ServiceDiscoveryBehavior 行為並指定 AnnouncementEndpoint,則服務會在連線或離線時,自動傳送公告訊息。If a service adds the ServiceDiscoveryBehavior behavior and specifies an AnnouncementEndpoint the service automatically sends announcement messages when the service goes online or comes offline. 您可以在想要自行明確傳送公告訊息時使用此類別。Use this class when you want to explicitly send the announcement messages yourself.

建構函式

AnnouncementClient() AnnouncementClient() AnnouncementClient() AnnouncementClient()

建立 AnnouncementClient 類別的新執行個體。Creates a new instance of the AnnouncementClient class.

AnnouncementClient(AnnouncementEndpoint) AnnouncementClient(AnnouncementEndpoint) AnnouncementClient(AnnouncementEndpoint) AnnouncementClient(AnnouncementEndpoint)

使用指定的 AnnouncementClient 初始化 AnnouncementEndpoint 類別的新執行個體。Initializes a new instance of the AnnouncementClient class with the specified AnnouncementEndpoint.

AnnouncementClient(String) AnnouncementClient(String) AnnouncementClient(String) AnnouncementClient(String)

使用指定的端點組態,初始化 AnnouncementClient 類別的新執行個體。Initializes a new instance of the AnnouncementClient class with the specified endpoint configuration.

屬性

ChannelFactory ChannelFactory ChannelFactory ChannelFactory

取得與 AnnouncementClient 相關聯的通道處理站。Gets the channel factory associated with the AnnouncementClient.

ClientCredentials ClientCredentials ClientCredentials ClientCredentials

取得與 AnnouncementClient 相關聯的用戶端認證。Gets the client credentials associated with the AnnouncementClient.

Endpoint Endpoint Endpoint Endpoint

取得與 ServiceEndpoint 相關聯的 AnnouncementClientGets the ServiceEndpoint associated with the AnnouncementClient.

InnerChannel InnerChannel InnerChannel InnerChannel

取得與 AnnouncementClient 相關聯的內部通道。Gets the inner channel associated with the AnnouncementClient.

MessageSequenceGenerator MessageSequenceGenerator MessageSequenceGenerator MessageSequenceGenerator

取得或設定與 AnnouncementClient 相關聯的訊息序列產生器。Gets or sets the message sequence generator associated with the AnnouncementClient.

方法

AnnounceOffline(EndpointDiscoveryMetadata) AnnounceOffline(EndpointDiscoveryMetadata) AnnounceOffline(EndpointDiscoveryMetadata) AnnounceOffline(EndpointDiscoveryMetadata)

造成離線公告訊息 (Bye) 與指定的端點探索中繼資料一併傳送。Causes an offline announcement message (Bye) to be sent with the specified endpoint discovery metadata.

AnnounceOfflineAsync(EndpointDiscoveryMetadata) AnnounceOfflineAsync(EndpointDiscoveryMetadata) AnnounceOfflineAsync(EndpointDiscoveryMetadata) AnnounceOfflineAsync(EndpointDiscoveryMetadata)

造成離線公告訊息 (Bye) 與指定的端點探索中繼資料以非同步方式一併傳送。Causes an offline announcement message (Bye) to be sent asynchronously with the specified endpoint discovery metadata.

AnnounceOfflineAsync(EndpointDiscoveryMetadata, Object) AnnounceOfflineAsync(EndpointDiscoveryMetadata, Object) AnnounceOfflineAsync(EndpointDiscoveryMetadata, Object) AnnounceOfflineAsync(EndpointDiscoveryMetadata, Object)

造成離線公告訊息 (Bye) 與指定的端點探索中繼資料和使用者定義的狀態以非同步方式一併傳送。Causes an offline announcement message (Bye) to be sent asynchronously with the specified endpoint discovery metadata and user-defined state.

AnnounceOfflineTaskAsync(EndpointDiscoveryMetadata) AnnounceOfflineTaskAsync(EndpointDiscoveryMetadata) AnnounceOfflineTaskAsync(EndpointDiscoveryMetadata) AnnounceOfflineTaskAsync(EndpointDiscoveryMetadata)

造成離線工作公告訊息 (Bye) 與指定的端點探索中繼資料以非同步方式一併傳送。Causes an offline task announcement message (Bye) to be sent asynchronously with the specified endpoint discovery metadata.

AnnounceOnline(EndpointDiscoveryMetadata) AnnounceOnline(EndpointDiscoveryMetadata) AnnounceOnline(EndpointDiscoveryMetadata) AnnounceOnline(EndpointDiscoveryMetadata)

造成傳送線上公告訊息 (Hello)。Causes an online announcement message (Hello) to be sent.

AnnounceOnlineAsync(EndpointDiscoveryMetadata) AnnounceOnlineAsync(EndpointDiscoveryMetadata) AnnounceOnlineAsync(EndpointDiscoveryMetadata) AnnounceOnlineAsync(EndpointDiscoveryMetadata)

造成以非同步方式一併傳送線上公告 (Hello) 訊息與指定的端點探索中繼資料。Causes an online announcement (Hello) message to be sent asynchronously with the specified endpoint discovery metadata.

AnnounceOnlineAsync(EndpointDiscoveryMetadata, Object) AnnounceOnlineAsync(EndpointDiscoveryMetadata, Object) AnnounceOnlineAsync(EndpointDiscoveryMetadata, Object) AnnounceOnlineAsync(EndpointDiscoveryMetadata, Object)

造成線上公告 (Hello) 訊息與指定的端點探索中繼資料和使用者定義的狀態以非同步方式一併傳送。Causes an online announcement (Hello) message to be sent asynchronously with the specified endpoint discovery metadata and user-defined state.

AnnounceOnlineTaskAsync(EndpointDiscoveryMetadata) AnnounceOnlineTaskAsync(EndpointDiscoveryMetadata) AnnounceOnlineTaskAsync(EndpointDiscoveryMetadata) AnnounceOnlineTaskAsync(EndpointDiscoveryMetadata)

造成以非同步方式一併傳送線上工作公告 (Hello) 訊息與指定的端點探索中繼資料。Causes an online task announcement message (Hello) to be sent asynchronously with the specified endpoint discovery metadata.

BeginAnnounceOffline(EndpointDiscoveryMetadata, AsyncCallback, Object) BeginAnnounceOffline(EndpointDiscoveryMetadata, AsyncCallback, Object) BeginAnnounceOffline(EndpointDiscoveryMetadata, AsyncCallback, Object) BeginAnnounceOffline(EndpointDiscoveryMetadata, AsyncCallback, Object)

造成離線公告訊息 (Bye) 與指定的端點探索中繼資料和使用者定義的狀態以非同步方式一併傳送。Causes an offline announcement (Bye) message to be sent asynchronously with the specified endpoint discovery metadata and user-defined state. 指定的 AsyncCallback 會在作業完成時呼叫。The specified AsyncCallback is called when the operation completes.

BeginAnnounceOnline(EndpointDiscoveryMetadata, AsyncCallback, Object) BeginAnnounceOnline(EndpointDiscoveryMetadata, AsyncCallback, Object) BeginAnnounceOnline(EndpointDiscoveryMetadata, AsyncCallback, Object) BeginAnnounceOnline(EndpointDiscoveryMetadata, AsyncCallback, Object)

造成線上公告 (Hello) 訊息與指定的端點探索中繼資料和使用者定義的狀態以非同步方式一併傳送。Causes an online announcement (Hello) message to be sent asynchronously with the specified endpoint discovery metadata and user-defined state. 指定的 AsyncCallback 會在作業完成時呼叫。The specified AsyncCallback is called when the operation completes.

Close() Close() Close() Close()

關閉 AnnouncementClientCloses the AnnouncementClient.

EndAnnounceOffline(IAsyncResult) EndAnnounceOffline(IAsyncResult) EndAnnounceOffline(IAsyncResult) EndAnnounceOffline(IAsyncResult)

等候暫止的非同步離線公告完成。Waits for a pending asynchronous offline announcement to complete.

EndAnnounceOnline(IAsyncResult) EndAnnounceOnline(IAsyncResult) EndAnnounceOnline(IAsyncResult) EndAnnounceOnline(IAsyncResult)

等候暫止的非同步線上公告完成。Waits for a pending asynchronous online announcement to complete.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
Open() Open() Open() Open()

開啟 AnnouncementClientOpens the AnnouncementClient.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

事件

AnnounceOfflineCompleted AnnounceOfflineCompleted AnnounceOfflineCompleted AnnounceOfflineCompleted

在非同步離線公告 (Bye) 完成時發生。Occurs when an asynchronous offline announcement (Bye) completes.

AnnounceOnlineCompleted AnnounceOnlineCompleted AnnounceOnlineCompleted AnnounceOnlineCompleted

在非同步線上公告 (Hello) 完成時發生。Occurs when an asynchronous online announcement (Hello) completes.

明確介面實作

ICommunicationObject.Abort() ICommunicationObject.Abort() ICommunicationObject.Abort() ICommunicationObject.Abort()

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

ICommunicationObject.BeginClose(AsyncCallback, Object) ICommunicationObject.BeginClose(AsyncCallback, Object) ICommunicationObject.BeginClose(AsyncCallback, Object) ICommunicationObject.BeginClose(AsyncCallback, Object)

開始非同步作業以關閉通訊物件。Begins an asynchronous operation to close a communication object.

ICommunicationObject.BeginClose(TimeSpan, AsyncCallback, Object) ICommunicationObject.BeginClose(TimeSpan, AsyncCallback, Object) ICommunicationObject.BeginClose(TimeSpan, AsyncCallback, Object) ICommunicationObject.BeginClose(TimeSpan, AsyncCallback, Object)

開始非同步作業,關閉有已指定逾時的通訊物件。Begins an asynchronous operation to close a communication object with a specified timeout.

ICommunicationObject.BeginOpen(AsyncCallback, Object) ICommunicationObject.BeginOpen(AsyncCallback, Object) ICommunicationObject.BeginOpen(AsyncCallback, Object) ICommunicationObject.BeginOpen(AsyncCallback, Object)

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

ICommunicationObject.BeginOpen(TimeSpan, AsyncCallback, Object) ICommunicationObject.BeginOpen(TimeSpan, AsyncCallback, Object) ICommunicationObject.BeginOpen(TimeSpan, AsyncCallback, Object) ICommunicationObject.BeginOpen(TimeSpan, AsyncCallback, Object)

開始非同步作業,開啟有已指定時間間隔的通訊物件。Begins an asynchronous operation to open a communication object within a specified interval of time.

ICommunicationObject.Close() ICommunicationObject.Close() ICommunicationObject.Close() ICommunicationObject.Close()

導致通訊物件從目前的狀態轉換為已關閉狀態。Causes a communication object to transition from its current state into the closed state.

ICommunicationObject.Close(TimeSpan) ICommunicationObject.Close(TimeSpan) ICommunicationObject.Close(TimeSpan) ICommunicationObject.Close(TimeSpan)

在指定時間間隔內,讓通訊物件從目前的狀態轉換為已關閉狀態。Causes a communication object to transition from its current state into the closed state within a specified interval of time.

ICommunicationObject.Closed ICommunicationObject.Closed ICommunicationObject.Closed ICommunicationObject.Closed

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

ICommunicationObject.Closing ICommunicationObject.Closing ICommunicationObject.Closing ICommunicationObject.Closing

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

ICommunicationObject.EndClose(IAsyncResult) ICommunicationObject.EndClose(IAsyncResult) ICommunicationObject.EndClose(IAsyncResult) ICommunicationObject.EndClose(IAsyncResult)

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

ICommunicationObject.EndOpen(IAsyncResult) ICommunicationObject.EndOpen(IAsyncResult) ICommunicationObject.EndOpen(IAsyncResult) ICommunicationObject.EndOpen(IAsyncResult)

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

ICommunicationObject.Faulted ICommunicationObject.Faulted ICommunicationObject.Faulted ICommunicationObject.Faulted

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

ICommunicationObject.Open() ICommunicationObject.Open() ICommunicationObject.Open() ICommunicationObject.Open()

導致通訊物件從已建立狀態轉換為已開啟狀態。Causes a communication object to transition from the created state into the opened state.

ICommunicationObject.Open(TimeSpan) ICommunicationObject.Open(TimeSpan) ICommunicationObject.Open(TimeSpan) ICommunicationObject.Open(TimeSpan)

在指定時間間隔內,讓通訊物件從已建立狀態轉換為已開啟狀態。Causes a communication object to transition from the created state into the opened state within a specified interval of time.

ICommunicationObject.Opened ICommunicationObject.Opened ICommunicationObject.Opened ICommunicationObject.Opened

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

ICommunicationObject.Opening ICommunicationObject.Opening ICommunicationObject.Opening ICommunicationObject.Opening

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

ICommunicationObject.State ICommunicationObject.State ICommunicationObject.State ICommunicationObject.State

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

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

執行與釋放 (Free)、釋放 (Release) 或重設 Unmanaged 資源相關聯之應用程式定義的工作。Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

適用於