Bagikan melalui


IChannelReceiver.StartListening(Object) Metode

Definisi

Menginstruksikan saluran saat ini untuk mulai mendengarkan permintaan.

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)

Parameter

data
Object

Informasi inisialisasi opsional.

Atribut

Pengecualian

Pemanggil langsung tidak memiliki izin infrastruktur.

Contoh

// 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

Keterangan

Objek data dapat digunakan untuk meneruskan status inisialisasi tertentu ke saluran.

Berlaku untuk