Gets the remote address and port of the server (never the proxy).
Syntax
Visual Basic (Declaration) | |
---|
Public ReadOnly Property RemoteEndPoint As IPEndPoint |
Visual Basic (Usage) | Copy Code |
---|
Dim instance As TcpBase
Dim value As IPEndPoint
value = instance.RemoteEndPoint |
Managed Extensions for C++ | |
---|
public: __property IPEndPoint* get_RemoteEndPoint(); |
Property Value
The
IPEndPoint of the remote host. Returns
null if the
State is ConnectionState.Closed.
Example
This example demonstrates using the component State to update the UI.
C# | Copy Code |
---|
private void myComponent_StateChanged(object sender, EventArgs e)
{
//Always raised when connection is established or closed (State property changes)
switch (myComponent.State)
{
case Dart.Common.ConnectionState.Connected:
case Dart.Common.ConnectionState.ConnectedAndSecure:
//Update interface to indicate connection
textDisplay.ReadOnly = false;
textDisplay.BackColor = Color.WhiteSmoke;
Text = (myComponent.State == Dart.Common.ConnectionState.Connected)
? APP_NAME + " [Connected to " + myComponent.RemoteEndPoint.Address.ToString() + ":" +
myComponent.RemoteEndPoint.Port.ToString() + "]"
: APP_NAME + " [Securely Connected to " + myComponent.RemoteEndPoint.Address.ToString() + ":" +
myComponent.RemoteEndPoint.Port.ToString() + "]";
break;
case Dart.Common.ConnectionState.Closed:
//Update interface to indicate no connection
textDisplay.ReadOnly = true;
textDisplay.BackColor = Color.Silver;
this.Text = APP_NAME + " [Not Connected]";
break;
}
} |
C# | Copy Code |
---|
Private Sub myComponent_StateChanged(ByVal sender As Object, ByVal e As EventArgs) Handles myComponent.StateChanged
'Always raised when Connection is established or closed (State property changes)
Select Case myComponent.State
Case Dart.Common.ConnectionState.Connected, Dart.Common.ConnectionState.ConnectedAndSecure
'Update interface to indicate connection
textDisplay.ReadOnly = False
textDisplay.BackColor = Color.WhiteSmoke
If (myComponent.State = Dart.Common.ConnectionState.Connected) Then
Text = APP_NAME & " [Connected to " & myComponent.RemoteEndPoint.Address.ToString() _
& ":" & myComponent.RemoteEndPoint.Port.ToString() & "]"
Else
Text = APP_NAME & " [Securely Connected to " & myComponent.RemoteEndPoint.Address.ToString() _
& ":" & myComponent.RemoteEndPoint.Port.ToString() & "]"
End If
Case Dart.Common.ConnectionState.Closed
'Update interface to indicate no connection
textDisplay.ReadOnly = True
textDisplay.BackColor = Color.Silver
Me.Text = APP_NAME & " [Not Connected]"
End Select
End Sub |
Requirements
Target Platforms: Microsoft .NET Framework 2.0
See Also