Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
myDNSListener Class Reference
Inheritance diagram for myDNSListener:
Inheritance graph
Collaboration diagram for myDNSListener:
Collaboration graph

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS myDNSListener (const char *host, PRInt32 index)
virtual ~myDNSListener ()
NS_IMETHOD OnLookupComplete (nsICancelable *request, nsIDNSRecord *rec, nsresult status)
void onLookupComplete (in nsICancelable aRequest, in nsIDNSRecord aRecord, in nsresult aStatus)
 called when an asynchronous host lookup completes.

Private Attributes

nsCString mHost
PRInt32 mIndex

Detailed Description

Definition at line 53 of file TestDNS.cpp.

Constructor & Destructor Documentation

NS_DECL_ISUPPORTS myDNSListener::myDNSListener ( const char *  host,
PRInt32  index 
) [inline]

Definition at line 58 of file TestDNS.cpp.

        : mHost(host)
        , mIndex(index) {}
virtual myDNSListener::~myDNSListener ( ) [inline, virtual]

Definition at line 61 of file TestDNS.cpp.


Member Function Documentation

void nsIDNSListener::onLookupComplete ( in nsICancelable  aRequest,
in nsIDNSRecord  aRecord,
in nsresult  aStatus 
) [inherited]

called when an asynchronous host lookup completes.

aRequestthe value returned from asyncResolve.
aRecordthe DNS record corresponding to the hostname that was resolved. this parameter is null if there was an error.
aStatusif the lookup failed, this parameter gives the reason.
NS_IMETHOD myDNSListener::OnLookupComplete ( nsICancelable request,
nsIDNSRecord rec,
nsresult  status 
) [inline]

Definition at line 63 of file TestDNS.cpp.

        printf("%d: OnLookupComplete called [host=%s status=%x rec=%p]\n",
            mIndex, mHost.get(), status, (void*)rec);

        if (NS_SUCCEEDED(status)) {
            nsCAutoString buf;

            printf("%d: canonname=%s\n", mIndex, buf.get());

            PRBool hasMore;
            while (NS_SUCCEEDED(rec->HasMore(&hasMore)) && hasMore) {
                printf("%d: => %s\n", mIndex, buf.get());

        return NS_OK;

Here is the call graph for this function:

Member Data Documentation

Definition at line 87 of file TestDNS.cpp.

Definition at line 88 of file TestDNS.cpp.

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