his book shows how to retrieve all IP addresses of the local computer. This is very useful
when writing server applications. A server socket is bound to a single IP address only.
But if a computer has more than one IP address the server will receive queries only if the
client explicitely sends them to the bound IP. So the server should bind its service to
all IP addresses of the computer.
Get all IP addresses
o retrieve all IP addresses this function calls "GetHostByName" from the WinAPI. This
API call returns a pointer to a HostEnt structure which holds lot of interesting network
information about a computer. This includes the hosts full qualified domain name, a list
of its alias names, and all of its IP addresses.
'Author : Daniel, Master Sourcerer at Kitana's Cas...
'Last change: March 15, 2004
'Email : firstname.lastname@example.org
'Retrieves all IP addresses of the local computer
'Converts an IP address to a string
FOR I&=1 TO 4
X&=P& AND 255
IF A$<>""THEN A$=A$+"."