Qore Programming Language  0.8.3
Public Member Functions | Static Public Member Functions
QoreAddrInfo Class Reference

List of all members.

Public Member Functions

DLLEXPORT QoreAddrInfo ()
 create an empty structure
DLLEXPORT ~QoreAddrInfo ()
 destroy the object
DLLEXPORT void clear ()
 clears the current results, if any
DLLEXPORT int getInfo (ExceptionSink *xsink, const char *node, const char *service, int family=Q_AF_UNSPEC, int flags=0, int socktype=Q_SOCK_STREAM, int protocol=0)
 get address info with the given parameters, if any errors occur, a Qore-language exception is thrown
DLLLOCAL struct addrinfo * getAddrInfo () const
 returns the struct addrinfo * being managed (may by 0)
DLLEXPORT QoreListNodegetList () const
 returns a list of hashes of address info, if an addrinfo structure is being managed

Static Public Member Functions

static DLLEXPORT const char * getFamilyName (int address_family)
 returns the name of the address family as a string (ie AF_INET = "ipv4", etc)
static DLLEXPORT QoreStringNodegetAddressDesc (int address_family, const char *addr)
 returns a descriptive string for the address family and an address string (ie AF_INET6, "::1" = "ipv6[::1]")

Member Function Documentation

DLLEXPORT int QoreAddrInfo::getInfo ( ExceptionSink xsink,
const char *  node,
const char *  service,
int  family = Q_AF_UNSPEC,
int  flags = 0,
int  socktype = Q_SOCK_STREAM,
int  protocol = 0 
)

get address info with the given parameters, if any errors occur, a Qore-language exception is thrown

Parameters:
xsinkif any errors occur, Qore-language exception info is added to this object
nodethe node name for the lookup
servicethe service name (from /etc/services, for example) or port number
familya hint for the address family, AF_UNSPEC means any family
flagshint flags as per the getaddrinfo() call: AI_ADDRCONFIG, AI_ALL, AI_CANONNAME, AI_NUMERICHOST, AI_NUMERICSERV, AI_PASSIVE, AI_V4MAPPED
socktypea hint for the type of socket; 0 = any socket type
protocola hint for the protocol number; 0 = the default protocol

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines