Szerkesztés

Megosztás a következőn keresztül:


IChannelReceiver.StartListening(Object) Method

Definition

Instructs the current channel to start listening for requests.

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)

Parameters

data
Object

Optional initialization information.

Attributes

Exceptions

The immediate caller does not have infrastructure permission.

Examples

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

Remarks

The data object can be used to pass specific initialization state to the channel.

Applies to