Search Result

Collapse
2 results in 0.0037 seconds.
Keywords
Members
Tags
getaddrinfo
  •  

  • Adam01
    started a topic Cygwin sockets: getaddrinfo undeclared
    in C

    Cygwin sockets: getaddrinfo undeclared

    Im using cygwin to test the code of a server I am writing.
    I've included sys/types.h, sys/socket.h, netdb.h, and arpa/inet.h.

    And this is the output..
    Code:
    ../../../sockets.cpp: In constructor `network_class::network_class()':
    ../../../sockets.cpp:64: error: aggregate `addrinfo hints' has incomplete type a
    nd cannot be defined
    ../../../sockets.cpp:69: error: `getaddrinfo' undeclared (first use
    ...
    See more | Go to post

  • Xx r3negade
    started a topic C socket woes
    in C

    C socket woes

    I am having trouble using connect() when entering struct addrinfo members as parameters.

    Code:
    int tcpConnect()
    {
        struct addrinfo hints;
        struct addrinfo *ai = NULL;
        int res;
        int sock1;
        char * ipaddr = "127.0.0.1";
        char * port = "80";
    
        memset(&hints, 0, sizeof(hints));
        hints.ai_family = AF_INET;
    ...
    See more | Go to post
Working...