ZNC  trunk
Public Member Functions | List of all members
CGetAddrInfo Class Reference

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...
 

Detailed Description

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

Constructor & Destructor Documentation

◆ CGetAddrInfo()

CGetAddrInfo::CGetAddrInfo ( const CS_STRING sHostname,
Csock pSock,
CSSockAddr csSockAddr 
)

ctor

Parameters
sHostnamethe host to resolve
pSockthe sock being setup, this option can be NULL, if it is null csSockAddr is only setup
csSockAddrthe struct that sockaddr data is being copied to

◆ ~CGetAddrInfo()

CGetAddrInfo::~CGetAddrInfo ( )

Member Function Documentation

◆ Finish()

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

◆ Init()

void CGetAddrInfo::Init ( )

simply sets up m_cHints for use in process

◆ Process()

int CGetAddrInfo::Process ( )

the simplest part of the function, only calls getaddrinfo and uses only m_sHostname, m_pAddrRes, and m_cHints.


The documentation for this class was generated from the following file: