共用方式為


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

備註

數據物件可用來將特定初始化狀態傳遞至通道。

適用於