Go to the source code of this file.
uint32 ResolveIP |
( |
const char * |
hostname, |
|
|
char * |
errbuf |
|
) |
| |
Definition at line 30 of file NetUtils.cpp.
References ERRBUF_SIZE, and snprintf.
31 #ifdef HAVE_WINSOCK2_H
32 static InitWinsock ws;
37 if( hostname == NULL )
44 hostent* phostent = gethostbyname( hostname );
48 #ifdef HAVE_WINSOCK2_H
49 snprintf( errbuf,
ERRBUF_SIZE,
"Unable to get the host name. Error: %i", WSAGetLastError() );
51 snprintf( errbuf,
ERRBUF_SIZE,
"Unable to get the host name. Error: %s", strerror( errno ) );
57 memcpy( &addr, phostent->h_addr, phostent->h_length );