Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Attributes | Private Member Functions
nsReceiver Class Reference
Inheritance diagram for nsReceiver:
Inheritance graph
[legend]
Collaboration diagram for nsReceiver:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_DECL_ISUPPORTS NS_IMETHOD Run ()
 Defines an entry point for a newly created thread.
 nsReceiver (nsIInputStream *in)
PRUint32 GetBytesRead ()
void run ()

Protected Attributes

nsIInputStreammIn
PRUint32 mCount

Private Member Functions

 ~nsReceiver ()

Detailed Description

Definition at line 76 of file TestPipes.cpp.


Constructor & Destructor Documentation

Definition at line 110 of file TestPipes.cpp.

                                   : mIn(in), mCount(0) {
        NS_ADDREF(in);
    }

Here is the call graph for this function:

nsReceiver::~nsReceiver ( ) [inline, private]

Definition at line 117 of file TestPipes.cpp.

                  {
        NS_RELEASE(mIn);
    }

Member Function Documentation

Definition at line 114 of file TestPipes.cpp.

{ return mCount; }

Here is the caller graph for this function:

void nsIRunnable::run ( ) [inherited]

Defines an entry point for a newly created thread.

Implements nsIRunnable.

Definition at line 80 of file TestPipes.cpp.

                     {
        nsresult rv;
        char buf[101];
        PRUint32 count;
        PRIntervalTime start = PR_IntervalNow();
        while (PR_TRUE) {
            rv = mIn->Read(buf, 100, &count);
            if (NS_FAILED(rv)) {
                printf("read failed\n");
                break;
            }
            if (count == 0) {
//                printf("EOF count = %d\n", mCount);
                break;
            }

            if (gTrace) {
                printf("read:  ");
                buf[count] = '\0';
                printf(buf);
                printf("\n");
            }
            mCount += count;
        }
        PRIntervalTime end = PR_IntervalNow();
        printf("read  %d bytes, time = %dms\n", mCount,
               PR_IntervalToMilliseconds(end - start));
        return rv;
    }

Member Data Documentation

Definition at line 123 of file TestPipes.cpp.

Definition at line 122 of file TestPipes.cpp.


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