IChannelReceiver.StartListening(Object) 方法

定义

指示当前信道开始侦听请求。

public:
 void StartListening(System::Object ^ data);
public void StartListening (object data);
[System.Security.SecurityCritical]
public void StartListening (object data);
abstract member StartListening : obj -> unit
[<System.Security.SecurityCritical>]
abstract member StartListening : obj -> unit
Public Sub StartListening (data As Object)

参数

data
Object

可选的初始化信息。

属性

例外

直接调用方没有基础结构权限。

示例

// Start listening to the port.
virtual void StartListening( Object^ data )
{
   if ( myListening == false )
   {
      myTcpListener->Start();
      myListening = true;
      Console::WriteLine( "Server Started Listening !!!" );
   }
}
// Start listening to the port.
public void StartListening(object data)
{
   if(myListening == false)
   {
      myTcpListener.Start();
      myListening = true;
      Console.WriteLine("Server Started Listening !!!");
   }
}
' Start listening to the port.
Public Sub StartListening(ByVal data As Object) Implements IChannelReceiver.StartListening
   If myListening = False Then
       myTcpListener.Start()
       myListening = True
       Console.WriteLine("Server Started Listening !!!")
   End If
End Sub

注解

数据对象可用于将特定的初始化状态传递给通道。

适用于