![]() |
Help Needed in sockets in C
Code:
/*Code:
for(p = res;p != NULL; p = p->ai_next) {1. Why do we need this loop and what is the mechanism of this p->next etc. 2.please explain me the whole loop rely seeking for your help . and i have a problem in understanding this function inet_ntop and this code how it works :- Code:
inet_ntop(p->ai_family, addr, ipstr, sizeof ipstr);more and more tutorials but none of them help please help me. Rely seeking your help. |
Re: Help Needed in sockets in C
Do not post the same thread more than once and your other thread is deleted.
|
Re: Help Needed in sockets in C
res points to a struct addrinfo
This article explains how linked lists work: http://en.wikipedia.org/wiki/Linked_list The X box at the right of the topmost illustration would typically be NULL. > i have a problem in understanding this function inet_ntop Well, did you try Googling it? No, methinks, because the top hit at http://lmgtfy.com/?q=inet_ntop is an OpenGroup documentation link. Did you try reading the comment just before it ("// convert the IP to a string and print it:")? I guess not otherwise you wouldn't have asked. |
| All times are GMT +5.5. The time now is 16:43. |