Internet Direct (Indy) Version 9.0.2 Beta
TIdSocketHandle.SetPeer
Updates the remote address of a socket connection.

procedure SetPeer(const asIP: string; anPort: integer);
Parameters
const asIP: string
IP address for the remote connection.

anPort: integer
Port number for the remote connection.

Description
SetPeer is a procedure used to update the PeerIP and PeerPort properties of the socket connection.

SetPeer is a convenience method provided for TIdTCPConnection descendants that may need to update the Binding property, like TIdTCPClient and TIdUDPBase.

SetPeer is also used by the listening thread of server applications that spawn new threads for each connection request, like TIdListenerThread and TIdUDPListenerThread.