Getting and Setting IP Addresses Tutorial

This topic describes how to get and set IP addresses.

Introduction

To establish a connection with the host, the IP addresses must be determined and set. The IP address can be local or remote. This tutorial describes the following:

Note: Usually IP address are automatically allocated to client applications when a dial-up connection is established.

How to Get a Local IP Address

The RSocket::LocalName() function is used to get the local IP address and the port.

How to Get a Remote IP Address

The RSocket::RemoteName() function is used to get the remote IP address and the port

How to Set the Local IP Address

The RSocket::Bind() function is used to set the local IP address and the port. This call must be made by server applications before calling RSocket::Listen(). To get and set the IP address, the <code>anAddr</code> argument must be of the class . TInetAddr.