See Also

Udp Class  | Udp Members

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Language

Visual Basic

C#

C++

C++/CLI

Show All

See Also Languages PowerTCP SSL Sockets for .NET

LocalEndPoint Property

Dart.PowerTCP.SslSockets Namespace > Udp Class : LocalEndPoint Property (Udp)

Gets the IP interface and port currently in use.

[Visual Basic]
<DescriptionAttribute("Gets the IP interface and port in use.")> <CategoryAttribute("Socket Info")> <BrowsableAttribute(False)> Public ReadOnly Property LocalEndPoint As IPEndPoint
[C#]
[DescriptionAttribute("Gets the IP interface and port in use.")] [CategoryAttribute("Socket Info")] [BrowsableAttribute(false)] public IPEndPoint LocalEndPoint {get;}
[C++]
[DescriptionAttribute("Gets the IP interface and port in use.")] [CategoryAttribute("Socket Info")] [BrowsableAttribute(false)] public: __property IPEndPoint* get_LocalEndPoint();
[C++/CLI]
[DescriptionAttribute("Gets the IP interface and port in use.")] [CategoryAttribute("Socket Info")] [BrowsableAttribute(false)] public: property IPEndPoint^ LocalEndPoint {    IPEndPoint^ get(); }

Return Type

The local IPEndPoint that the Udp object is using for communications.

Remarks

This property exposes the local IP address and port being used. If a dot address or host name was specified for the Open operation, then the resolved dot address is shown here. If no address or name was specified, then an address of 0.0.0.0 is reported. If a local port was specified for the Open operation, then the port is shown here. If no port was specified, then the "ephemeral" port chosen by the system will be shown here.

Example

The following example demonstrates the Udp.ActiveChanged event

[Visual Basic] 

Private Sub ActiveChangedTest()
   ' Create an IPEndPoint
   Dim ep As System.Net.IPEndPoint = New System.Net.IPEndPoint(System.Net.IPAddress.Parse("192.168.0.71"), 1111)

   ' Begin listening on the specified endpoint. The ActiveChanged event should be raised.
   Udp1.Open(ep)

   ' Stop listening. The ActiveChanged event should be raised again.
   Udp1.Close()
End Sub

Private Sub Udp1_ActiveChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Udp1.ActiveChanged
   If Udp1.Active Then
      Debug.WriteLine("Listening on " + Udp1.LocalEndPoint.ToString())
   Else
      Debug.WriteLine("Not Listening")
   End If
End Sub

[C#] 


private void ActiveChangedTest()
{
  
// Create an IPEndPoint
  
System.Net.IPEndPoint ep = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("192.168.0.71"), 1111);

  
// Begin listening on the specified endpoint. The ActiveChanged event should be raised.
  
udp1.Open(ep);

  
// Stop listening. The ActiveChanged event should be raised again.
  
udp1.Close();
}

private void udp1_ActiveChanged(object sender, System.EventArgs e)
{
  
if(udp1.Active)
     Debug.WriteLine(
"Listening on " + udp1.LocalEndPoint.ToString());
  
else
  {
     
Debug.WriteLine("Not Listening")
  }
}
                

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Udp Class  | Udp Members


Send comments on this topic.

Documentation version 1.1.2.0.

© 2008 Dart Communications.  All rights reserved.