IChannelReceiver.StopListening(Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
指示当前信道停止侦听请求。
public:
void StopListening(System::Object ^ data);
public void StopListening (object data);
[System.Security.SecurityCritical]
public void StopListening (object data);
abstract member StopListening : obj -> unit
[<System.Security.SecurityCritical>]
abstract member StopListening : obj -> unit
Public Sub StopListening (data As Object)
参数
- data
- Object
该信道的可选状态信息。
- 属性
例外
直接调用方没有基础结构权限。
示例
// Extract the channel URI and the remote well known object URI from the specified URL.
Console::WriteLine( "Parsed : {0}", myHttpServerChannel->Parse( String::Concat( myHttpServerChannel->GetChannelUri(), "/SayHello" ), myString ) );
Console::WriteLine( "Remote WellKnownObject : {0}", myString );
Console::WriteLine( "Hit <enter> to stop listening..." );
Console::ReadLine();
// Stop listening to channel.
myHttpServerChannel->StopListening( myPort );
// Extract the channel URI and the remote well known object URI from the specified URL.
Console.WriteLine("Parsed : " +
myHttpServerChannel.Parse(myHttpServerChannel.GetChannelUri()+
"/SayHello",out myString));
Console.WriteLine("Remote WellKnownObject : " + myString);
Console.WriteLine("Hit <enter> to stop listening...");
Console.ReadLine();
// Stop listening to channel.
myHttpServerChannel.StopListening((object)myPort);
' Extract the channel URI and the remote well known object URI from the specified URL.
Console.WriteLine("Parsed : " + _
myHttpServerChannel.Parse(myHttpServerChannel.GetChannelUri() + "/SayHello", myString))
Console.WriteLine("Remote WellKnownObject : " + myString)
Console.WriteLine("Hit <enter> to stop listening...")
Console.ReadLine()
' Stop listening to channel.
myHttpServerChannel.StopListening(CType(myPort, Object))
注解
数据对象可用于将特定状态传递给通道。