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 ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา