Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions | Variables
nsSocketTransportService2.cpp File Reference
#include "nsSocketTransportService2.h"
#include "nsSocketTransport2.h"
#include "nsReadableUtils.h"
#include "nsAutoLock.h"
#include "nsNetError.h"
#include "prnetdb.h"
#include "prlock.h"
#include "prerror.h"
#include "plstr.h"

Go to the source code of this file.


#define PLEVENT_FROM_LINK(_link)   ((PLEvent*) ((char*) (_link) - offsetof(PLEvent, link)))


static void MoveCList (PRCList &from, PRCList &to)
 NS_IMPL_THREADSAFE_ISUPPORTS4 (nsSocketTransportService, nsISocketTransportService, nsIEventTarget, nsIRunnable, nsPISocketTransportService) NS_IMETHODIMP nsSocketTransportService


nsSocketTransportServicegSocketTransportService = nsnull
PRThreadgSocketThread = nsnull

Define Documentation

#define PLEVENT_FROM_LINK (   _link)    ((PLEvent*) ((char*) (_link) - offsetof(PLEvent, link)))

Definition at line 60 of file nsSocketTransportService2.cpp.

Function Documentation

static void MoveCList ( PRCList &  from,
PRCList &  to 
) [inline, static]

Definition at line 64 of file nsSocketTransportService2.cpp.

    if (!PR_CLIST_IS_EMPTY(&from)) { =;
        to.prev = from.prev;>prev = &to;
        to.prev->next = &to;

Here is the caller graph for this function:

Definition at line 403 of file nsSocketTransportService2.cpp.

    NS_ASSERTION(nsIThread::IsMainThread(), "wrong thread");

    if (mInitialized)
        return NS_OK;

    if (!mThreadEvent) {
        mThreadEvent = PR_NewPollableEvent();
        // NOTE: per bug 190000, this failure could be caused by Zone-Alarm
        // or similar software.
        // NOTE: per bug 191739, this failure could also be caused by lack
        // of a loopback device on Windows and OS/2 platforms (NSPR creates
        // a loopback socket pair on these platforms to implement a pollable
        // event object).  if we can't create a pollable event, then we'll
        // have to "busy wait" to implement the socket event queue :-(
        if (!mThreadEvent) {
            NS_WARNING("running socket transport thread without a pollable event");
            LOG(("running socket transport thread without a pollable event"));

    nsresult rv = NS_NewThread(&mThread, this, 0, PR_JOINABLE_THREAD);
    if (NS_FAILED(rv)) return rv;

    mInitialized = PR_TRUE;
    return NS_OK;

Here is the call graph for this function:

Variable Documentation

Definition at line 58 of file nsSocketTransportService2.cpp.

Definition at line 57 of file nsSocketTransportService2.cpp.