共用方式為


IClientChannelSinkProvider.CreateSink(IChannelSender, String, Object) 方法

定義

建立接收鏈結。

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

要連接至的物件 URL。 如果連接完全根據包含在 remoteChannelData 參數中的資訊,則這個參數可以是 null

remoteChannelData
Object

通道資料物件,其描述遠端伺服器上的通道。

傳回

IClientChannelSink

新建構的通道接收鏈結的第一個接收,或 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 送到鏈結中的下一個接收提供者, (如果有一個) ,並確保下一個接收和目前的接收會連結在一起。

適用於