IClientChannelSinkProvider.CreateSink(IChannelSender, String, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
形成一個水槽鏈。
public:
System::Runtime::Remoting::Channels::IClientChannelSink ^ CreateSink(System::Runtime::Remoting::Channels::IChannelSender ^ channel, System::String ^ url, System::Object ^ remoteChannelData);
public System.Runtime.Remoting.Channels.IClientChannelSink CreateSink(System.Runtime.Remoting.Channels.IChannelSender channel, string url, object remoteChannelData);
[System.Security.SecurityCritical]
public System.Runtime.Remoting.Channels.IClientChannelSink CreateSink(System.Runtime.Remoting.Channels.IChannelSender channel, string url, object remoteChannelData);
abstract member CreateSink : System.Runtime.Remoting.Channels.IChannelSender * string * obj -> System.Runtime.Remoting.Channels.IClientChannelSink
[<System.Security.SecurityCritical>]
abstract member CreateSink : System.Runtime.Remoting.Channels.IChannelSender * string * obj -> System.Runtime.Remoting.Channels.IClientChannelSink
Public Function CreateSink (channel As IChannelSender, url As String, remoteChannelData As Object) As IClientChannelSink
參數
- channel
- IChannelSender
目前建造匯流鏈的通道。
- url
- String
要連接的物件網址。 若連線完全基於參數null中包含的資訊,則可remoteChannelData為此參數。
- remoteChannelData
- Object
一個描述遠端伺服器通道的資料物件。
傳回
新形成的通道匯鏈的第一個匯,或 null,表示該提供者不會或無法為該端點提供連接。
- 屬性
例外狀況
直接呼叫者沒有基礎設施權限。
範例
以下程式碼範例說明此方法的實作。
virtual IClientChannelSink^ CreateSink( IChannelSender^ channel, String^ url, Object^ remoteChannelData )
{
Console::WriteLine( "Creating ClientSink for {0}", url );
// Create the next sink in the chain.
IClientChannelSink^ nextSink = nextProvider->CreateSink( channel, url, remoteChannelData );
// Hook our sink up to it.
return (gcnew ClientSink( nextSink ));
}
public IClientChannelSink CreateSink (IChannelSender channel, String url, Object remoteChannelData)
{
Console.WriteLine("Creating ClientSink for {0}", url);
// Create the next sink in the chain.
IClientChannelSink nextSink = nextProvider.CreateSink(channel, url, remoteChannelData);
// Hook our sink up to it.
return( new ClientSink(nextSink) );
}
備註
當 CreateSink 該方法被呼叫時,會建立自己的通道匯,將呼叫轉發 CreateSink 給鏈中下一個匯流提供者(如果有的話),並確保下一個匯流與目前匯流者連結在一起。