Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Feb : Re: multiple addresses returned...
| Subject: | Re: multiple addresses returned... |
| Posted by: | "Remy Lebeau (TeamB)" (no.spam@no.spam.com) |
| Date: | Tue, 5 Feb 2008 13:53:50 |
"mataus" <mataus@gmail.com> wrote in message
news:47a8ce9f@newsgroups.borland.com...
> I'am i right that getaddrinfo() can return many IP's for a url?
Yes.
> If so, how do i access each one?
If you read the documentation for getaddrinfo(), it tells you how. The
output is a linked list of addrinfo records - one for each address. Simply
loop through the list one item at a time until you reach a nil item.
> Also how do i do same thing with gethostbyname() i.e. access
> each address..
Again, please read the documentation. The output is a hostent record that
has an h_addr_list member, which is an array of addresses. Simply loop
through the array until you reach a NULL item.
Gambit
none