| Arthur 2007-07-12, 7:19 am |
| On Jul 12, 7:29 am, Arthur <wangdas...@gmail.com> wrote:
> On Jul 12, 7:16 am, Rainer Weikusat <rweiku...@mssgmbh.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
> I have changed the var name to avoid the confusion. Please see my demo
> code below:
> int main()
> {
> struct addrinfo hints;
> struct addrinfo *info;
> int s;
> memset((char*) &hints, '\0', sizeof(hints));
> hints.ai_family = AF_INET; // just IPv4 for now
> hints.ai_socktype = SOCK_STREAM; // just TCP
> s = getaddrinfo("test.domain.com", NULL, &hints, &info);
> if (s != 0) { printf ("error\n"); }
> printf ("ok\n");
> return 0;
>
> }
>
> I have checked info->ai_next with gdb, it's always NULL. Is there
> anything wrong in my demo code? My platform it RHEL 4.0.
>
> Best Regards & Thanks,
>
> Arthur
BTW. Running the same program on Solaris 8, that program can return
the right result (2 IP address).
Arthur
|