get Ip address from sockaddr

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//Server
    int sock;
    pthread_t thread;
    struct addrinfo hints, *res;
    int reuseaddr = 1; /* True */

    /* Get the address info */
    
    hints.ai_family = AF_INET;
    hints.ai_socktype = SOCK_STREAM;

    struct addrinfo hints;

   //some codes socket, bind etc

    printf("%s", inet_ntoa("I am lost what to put here"));//I need the server   IP address
thanks, but hate that site :)
Uh, OK. I can't see how anyone can hate stackoverflow, but regardless the post answers your question.
Topic archived. No new replies allowed.