IChannelReceiver.StartListening(Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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 )
{
myTcpListener->Start();
myListening = true;
Console::WriteLine( "Server Started Listening !!!" );
}
}
// Start listening to the port.
public void StartListening(object data)
{
if (!myListening)
{
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
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.