IpcChannel.CreateMessageSink(String, Object, String) Método

Definição

Retorna um coletor de mensagem de canal que entrega mensagens ao objeto de dados de URL ou de canal especificado.Returns a channel message sink that delivers messages to the specified URL or channel data object.

public:
 virtual System::Runtime::Remoting::Messaging::IMessageSink ^ CreateMessageSink(System::String ^ url, System::Object ^ remoteChannelData, [Runtime::InteropServices::Out] System::String ^ % objectURI);
public System.Runtime.Remoting.Messaging.IMessageSink CreateMessageSink (string url, object remoteChannelData, out string objectURI);
abstract member CreateMessageSink : string * obj * string -> System.Runtime.Remoting.Messaging.IMessageSink
override this.CreateMessageSink : string * obj * string -> System.Runtime.Remoting.Messaging.IMessageSink
Public Function CreateMessageSink (url As String, remoteChannelData As Object, ByRef objectURI As String) As IMessageSink

Parâmetros

url
String

A URL à qual o novo coletor deverá entregar mensagens.The URL to which the new sink should deliver messages. Pode ser null.Can be null.

remoteChannelData
Object

O objeto de dados de canal do host remoto ao qual o novo coletor deverá entregar mensagens.The channel data object of the remote host to which the new sink should deliver messages. Pode ser null.Can be null.

objectURI
String

Quando este método retorna, contém um URI do novo coletor de mensagem de canal que entrega mensagens ao objeto de dados de URL ou de canal especificado.When this method returns, contains a URI of the new channel message sink that delivers messages to the specified URL or channel data object. Este parâmetro é passado não inicializado.This parameter is passed uninitialized.

Retornos

IMessageSink

Um coletor de mensagem de canal que entrega mensagens ao objeto de dados de URL ou de canal especificado.A channel message sink that delivers messages to the specified URL or channel data object.

Implementações

Exemplos

O exemplo de código a seguir mostra como usar o método CreateMessageSink.The following code example shows how to use the CreateMessageSink method. Este exemplo de código faz parte de um exemplo maior fornecido para a IpcChannel classe.This code example is part of a larger example provided for the IpcChannel class.

// Create a message sink.
String^ objectUri;
System::Runtime::Remoting::Messaging::IMessageSink^ messageSink = channel->CreateMessageSink(
   L"ipc://localhost:9090/RemoteObject.rem", nullptr, objectUri );
Console::WriteLine( L"The URI of the message sink is {0}.", objectUri );
if ( messageSink != nullptr )
{
   Console::WriteLine( L"The type of the message sink is {0}.", messageSink->GetType() );
}


// Create a message sink.
string objectUri;
System.Runtime.Remoting.Messaging.IMessageSink messageSink =
    channel.CreateMessageSink(
        "ipc://localhost:9090/RemoteObject.rem", null,
        out objectUri);
Console.WriteLine("The URI of the message sink is {0}.",
    objectUri);
if (messageSink != null)
{
    Console.WriteLine("The type of the message sink is {0}.",
        messageSink.GetType().ToString());
}

Comentários

O CreateMessageSink método retorna um coletor de mensagens de canal que entrega mensagens para a URL ou objeto de dados de canal especificado.The CreateMessageSink method returns a channel message sink that delivers messages to either the specified URL or channel data object. Se o uri parâmetro for null , remoteChannelData será usado como um destino para o coletor.If the uri parameter is null, remoteChannelData is used as a target for the sink. Os url parâmetros ou remoteChannelData podem ser null , mas não ambos.Either the url or remoteChannelData parameters can be null, but not both.

Os coletores de canal fornecem um ponto de plug-in que permite o acesso às mensagens subjacentes que fluem pelo canal, bem como o fluxo usado pelo mecanismo de transporte para enviar mensagens a um objeto remoto.Channel sinks provide a plug-in point that allows access to the underlying messages flowing through the channel as well as the stream used by the transport mechanism to send messages to a remote object. Os coletores de canal são vinculados juntos em uma cadeia de ChannelSinkProviders e todas as mensagens de canal fluem por essa cadeia de coletores antes de a mensagem ser finalmente serializada e transportada.Channel sinks are linked together in a chain of ChannelSinkProviders and all channel messages flow through this chain of sinks before the message is finally serialized and transported.

Aplica-se a