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 == 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
Співпраця з нами на GitHub
Джерело цього вмісту можна знайти на GitHub, де також можна створювати й переглядати запитання та запити на внесення змін. Докладні відомості наведено в нашому посібнику для співавторів.