ZNC
trunk
|
this function is a wrapper around getaddrinfo (for ipv6) More...
#include <Csocket.h>
Public Member Functions | |
CGetAddrInfo (const CS_STRING &sHostname, Csock *pSock, CSSockAddr &csSockAddr) | |
ctor More... | |
~CGetAddrInfo () | |
void | Init () |
simply sets up m_cHints for use in process More... | |
int | Process () |
the simplest part of the function, only calls getaddrinfo and uses only m_sHostname, m_pAddrRes, and m_cHints. More... | |
int | Finish () |
finalizes and sets up csSockAddr (and pSock if not NULL), only needs to be called if Process returns 0, but can be called anyways if flow demands it More... | |
this function is a wrapper around getaddrinfo (for ipv6)
in the event this code is using ipv6, it calls getaddrinfo, and it tries to start the connection on each iteration in the linked list returned by getaddrinfo. if pSock is not NULL the following behavior happens.
Process can be called in a thread, but Init and Finish must only be called from the parent once the thread is complete
CGetAddrInfo::CGetAddrInfo | ( | const CS_STRING & | sHostname, |
Csock * | pSock, | ||
CSSockAddr & | csSockAddr | ||
) |
ctor
sHostname | the host to resolve |
pSock | the sock being setup, this option can be NULL, if it is null csSockAddr is only setup |
csSockAddr | the struct that sockaddr data is being copied to |
CGetAddrInfo::~CGetAddrInfo | ( | ) |
int CGetAddrInfo::Finish | ( | ) |
finalizes and sets up csSockAddr (and pSock if not NULL), only needs to be called if Process returns 0, but can be called anyways if flow demands it
void CGetAddrInfo::Init | ( | ) |
simply sets up m_cHints for use in process
int CGetAddrInfo::Process | ( | ) |
the simplest part of the function, only calls getaddrinfo and uses only m_sHostname, m_pAddrRes, and m_cHints.