StartListening Method
Collapse the table of content
Expand the table of content

IChannelReceiver.StartListening Method (Object)

 

Instructs the current channel to start listening for requests.

Namespace:   System.Runtime.Remoting.Channels
Assembly:  mscorlib (in mscorlib.dll)

[SecurityCriticalAttribute]
void StartListening(
	object data
)

Parameters

data
Type: System.Object

Optional initialization information.

Exception Condition
SecurityException

The immediate caller does not have infrastructure permission.

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

// Start listening to the port.
public void StartListening(object data)
{
   if(myListening == false)
   {
      myTcpListener.Start();
      myListening = true;
      Console.WriteLine("Server Started Listening !!!");
   }
}

SecurityPermission

for operating with infrastructure code. Demand value: SecurityAction.LinkDemand; Permission value: SecurityPermissionFlag.Infrastructure

.NET Framework
Available since 1.1
Return to top
Show:
© 2016 Microsoft