NetServices Stack source

Dependents:   HelloWorld ServoInterfaceBoardExample1 4180_Lab4

Embed: (wiki syntax)

« Back to documentation index

DNSRequest Class Reference

DNSRequest Class Reference

This is a simple DNS Request class. More...

#include <DNSRequest.h>

Public Member Functions

 DNSRequest ()
 Creates a new request.
 ~DNSRequest ()
 Terminates and closes request.
DNSRequestErr resolve (const char *hostname)
 Resolves an hostname.
DNSRequestErr resolve (Host *pHost)
 Resolves an hostname.
void setOnReply (void(*pMethod)(DNSReply))
 Setups callback.
template<class T >
void setOnReply (T *pItem, void(T::*pMethod)(DNSReply))
 Setups callback.
DNSRequestErr getResult (IpAddr *pIp)
 Gets IP address once it has been resolved.
DNSRequestErr close ()
 Closes DNS Request before completion.

Detailed Description

This is a simple DNS Request class.

This class exposes an API to deal with DNS Requests

Definition at line 66 of file DNSRequest.h.


Constructor & Destructor Documentation

DNSRequest (  )

Creates a new request.

Definition at line 27 of file DNSRequest.cpp.

~DNSRequest (  )

Terminates and closes request.

Definition at line 32 of file DNSRequest.cpp.


Member Function Documentation

DNSRequestErr close (  )

Closes DNS Request before completion.

Definition at line 98 of file DNSRequest.cpp.

DNSRequestErr getResult ( IpAddr pIp )

Gets IP address once it has been resolved.

Parameters:
pIp: pointer to an IpAddr instance in which to store the resolved IP address

Definition at line 88 of file DNSRequest.cpp.

DNSRequestErr resolve ( Host pHost )

Resolves an hostname.

Parameters:
host: hostname to resolve, the result will be stored in the IpAddr field of this object

Definition at line 55 of file DNSRequest.cpp.

DNSRequestErr resolve ( const char *  hostname )

Resolves an hostname.

Parameters:
hostname: hostname to resolve

Definition at line 37 of file DNSRequest.cpp.

void setOnReply ( void(*)(DNSReply pMethod )

Setups callback.

The callback function will be called on result.

Parameters:
pMethod: callback function

Definition at line 74 of file DNSRequest.cpp.

void setOnReply ( T *  pItem,
void(T::*)(DNSReply pMethod 
)

Setups callback.

The callback function will be called on result.

Parameters:
pItem: instance of class on which to execute the callback method
pMethod: callback method

Definition at line 102 of file DNSRequest.h.