Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site











SourceForge.net Logo

IpAddrInfo

 

class IpAddrInfo

This class encapsulates getaddrinfo API, also providing optional non-blocking behavior (using auxiliary threads). Note that there is currently no synchronization available for this non-blocking behavior (it is not possible to e.g. select on IpAddrInfo). Also note that IpAddrInfo has some maximum number (currently 256) of slots used to resolve hosts simultaneously, however when this number is exceeded, it only means that InProgress tries to put the request to the slot (and returns true if non available or if request is not resolved yet), so from the client view, this limit has little impact. It also means that client should release the slot as soon as possible, using Clear method or by destructing IpAddrInfo.

 

Public Method List

 

void Start(const String& host, int port, int family = FAMILY_ANY)

Starts resolving address of host (with port). family can be used to narrow the scan to particular IP protocol (FAMILY_IPV4, FAMILY_IPV6).

 


 

bool InProgress()

Returns true if resolving of address is still in progress.

 


 

bool Execute(const String& host, int port, int family = FAMILY_ANY)

Resolves address host (with port). This is blocking variant, returns after address is resolved. Returns true if address was found. family can be used to narrow the scan to particular IP protocol (FAMILY_IPV4, FAMILY_IPV6).

 


 

addrinfo *GetResult() const

Returns resulting addrinfo if address resolving was finished and successfull, NULL otherwise.

 


 

void Clear()

Resets IpAddrInfo to initial state. Not that this also releases the slot used for resolving the request.

 


 

IpAddrInfo()

~IpAddrInfo()

Constructor, destructor.

 

Last edit by cxl on 01/01/2016. Do you want to contribute?. T++