TcpClientChannel.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 virtual 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 Overridable Function CreateMessageSink (url As String, remoteChannelData As Object, ByRef objectURI As String) As IMessageSink
Parâmetros
- url
- String
A URL à qual o novo coletor entrega mensagens.The URL to which the new sink delivers messages. Pode ser null.Can be null.
- remoteChannelData
- Object
O objeto de dados de canal do host remoto ao qual o novo coletor entregará mensagens.The channel data object of the remote host to which the new sink will 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
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 o uso deste método.The following code example shows the use this method.
// Create a message sink.
String^ objectUri;
System::Runtime::Remoting::Messaging::IMessageSink^ messageSink = clientChannel->CreateMessageSink( "tcp://localhost:9090/RemoteObject.rem", nullptr, objectUri );
Console::WriteLine( "The URI of the message sink is {0}.", objectUri );
Console::WriteLine( "The type of the message sink is {0}.", messageSink->GetType() );
// Create a message sink.
string objectUri;
System.Runtime.Remoting.Messaging.IMessageSink messageSink =
clientChannel.CreateMessageSink(
"tcp://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 do canal que entrega mensagens para a URL especificada ou para o objeto de dados do canal.The CreateMessageSink method returns a channel message sink that delivers messages to either the specified URL or the 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.