PowerTCP Mail for .NET
RemoteEndPoint Property (TcpBase)
Example 




Gets the remote address and port of the connection.
Syntax
Public ReadOnly Property RemoteEndPoint As IPEndPoint
Dim instance As TcpBase
Dim value As IPEndPoint
 
value = instance.RemoteEndPoint
public IPEndPoint RemoteEndPoint {get;}
public: __property IPEndPoint* get_RemoteEndPoint();
public:
property IPEndPoint^ RemoteEndPoint {
   IPEndPoint^ get();
}

Property Value

The Socket.RemoteEndPoint. This value persists after the connection is closed.
Example
This example demonstrates using the StateChanged event and State property to update the UI.
private void myComponent_StateChanged(object sender, EventArgs e)
{
    if (myComponent.State == ConnectionState.Closed)
        this.Text = "Not Connected";
    else if (myComponent.State == ConnectionState.Connected)
        this.Text = "Connected to " + myComponent.RemoteEndPoint.ToString();
    else
        this.Text = "Securely connected to " + myComponent.RemoteEndPoint.ToString();
}
Private Sub myComponent_StateChanged(ByVal sender As Object, ByVal e As EventArgs)
    If myComponent.State = ConnectionState.Closed Then
        Me.Text = "Not Connected"
    ElseIf myComponent.State = ConnectionState.Connected Then
        Me.Text = "Connected to " & myComponent.RemoteEndPoint.ToString()
    Else
        Me.Text = "Securely connected to " & myComponent.RemoteEndPoint.ToString()
    End If
End Sub
See Also

Reference

TcpBase Class
TcpBase Members


PowerTCP Mail for .NET Documentation Version 4.3
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic