All pastes #773404 Raw Edit

Lauro

public c v1 · immutable
#773404 ·published 2007-11-14 14:48 UTC
rendered paste body
#include <sys/types.h>#include <sys/socket.h>#include <netdb.h>#include <stdio.h>#include <string.h>int main(int argc, char *argv[]){    char *node = "api.flickr.com";    char *serv = "80";    struct addrinfo hints;    memset(&hints, 0, sizeof(struct addrinfo));    hints.ai_socktype = SOCK_STREAM;    struct addrinfo *res;    int ret = 0;    ret = getaddrinfo(node, serv, &hints, &res);    if (ret) {        printf("Return code: %d\n", ret);        perror("getaddrinfo");        return 1;    }    return 0;}