Qore Programming Language  1.12.0
QoreAddrInfo Class Reference

provides an interface to getaddrinfo More...

#include <QoreNet.h>

Public Member Methods

DLLEXPORT QoreAddrInfo ()
 create an empty structure
 
DLLEXPORT ~QoreAddrInfo ()
 destroy the object
 
DLLEXPORT void clear ()
 clears the current results, if any
 
DLLLOCAL hashdecl addrinfo * getAddrInfo () const
 returns the hashdecl addrinfo * being managed (may by 0)
 
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 More...
 
DLLEXPORT QoreListNodegetList () const
 returns a list of hashes of address info, if an addrinfo structure is being managed
 

Static Public Member Methods

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]")
 
static DLLEXPORT const char * getFamilyName (int address_family)
 returns the name of the address family as a string (ie AF_INET = "ipv4", etc)
 

Detailed Description

provides an interface to getaddrinfo

Member Function Documentation

◆ getInfo()

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: