Logo Search packages:      
Sourcecode: egoboo version File versions  Download package

int enet_address_set_host ( ENetAddress address,
const char *  hostName 

Attempts to resolve the host named by the parameter hostName and sets the host field in the address parameter if successful.

address destination to store resolved address
hostName host name to lookup
Return values:
0 on success
< 0 on failure
the address of the given hostName in address on success

Definition at line 66 of file unix.c.

    struct hostent * hostEntry = NULL;
    struct hostent hostData;
    char buffer [2048];
    int errnum;

#ifdef linux
    gethostbyname_r (name, & hostData, buffer, sizeof (buffer), & hostEntry, & errnum);
    hostEntry = gethostbyname_r (name, & hostData, buffer, sizeof (buffer), & errnum);
    hostEntry = gethostbyname (name);

    if (hostEntry == NULL ||
        hostEntry -> h_addrtype != AF_INET)
      return -1;

    address -> host = * (enet_uint32 *) hostEntry -> h_addr_list [0];

    return 0;

Generated by  Doxygen 1.6.0   Back to index