MCPcopy Create free account
hub / github.com/Tencent/UnLua / inet_gethost

Function inet_gethost

Plugins/UnLuaExtensions/LuaSocket/Source/src/inet.cpp:55–61  ·  view source on GitHub ↗

=========================================================================*\ * Global Lua functions \*=========================================================================*/ -------------------------------------------------------------------------*\ * Returns all information provided by the resolver given a host name * or ip address \*------------------------------------------------------------

Source from the content-addressed store, hash-verified

53* or ip address
54\*-------------------------------------------------------------------------*/
55static int inet_gethost(const char *address, struct hostent **hp) {
56 struct in_addr addr;
57 if (inet_aton(address, &addr))
58 return socket_gethostbyaddr((char *) &addr, sizeof(addr), hp);
59 else
60 return socket_gethostbyname(address, hp);
61}
62
63/*-------------------------------------------------------------------------*\
64* Returns all information provided by the resolver given a host name

Callers 2

inet_global_tohostnameFunction · 0.85
inet_global_toipFunction · 0.85

Calls 3

inet_atonFunction · 0.85
socket_gethostbyaddrFunction · 0.70
socket_gethostbynameFunction · 0.70

Tested by

no test coverage detected