infoObject->Init(socksVersion, proxyHost, proxyPort);
infoObject->Init(socksVersion, proxyHost, proxyPort, host, flags);
nsSOCKSIOLayerAddToSocket(PRInt32 family,                          const char *host,                           PRInt32 port,                          const char *proxyHost,                          PRInt32 proxyPort,                          PRInt32 socksVersion,                          PRFileDesc *fd,                           nsISupports** info){    NS_ENSURE_TRUE((socksVersion == 4) || (socksVersion == 5), NS_ERROR_NOT_INITIALIZED);    if (firstTime)    {        nsSOCKSIOLayerIdentity		= PR_GetUniqueIdentity("SOCKS layer");        nsSOCKSIOLayerMethods		= *PR_GetDefaultIOMethods();                nsSOCKSIOLayerMethods.connect	= nsSOCKSIOLayerConnect;        nsSOCKSIOLayerMethods.bind	= nsSOCKSIOLayerBind;        nsSOCKSIOLayerMethods.acceptread = nsSOCKSIOLayerAcceptRead;        nsSOCKSIOLayerMethods.getsockname = nsSOCKSIOLayerGetName;        nsSOCKSIOLayerMethods.getpeername = nsSOCKSIOLayerGetPeerName;        nsSOCKSIOLayerMethods.accept	= nsSOCKSIOLayerAccept;        nsSOCKSIOLayerMethods.listen	= nsSOCKSIOLayerListen;        nsSOCKSIOLayerMethods.close	= nsSOCKSIOLayerClose;                firstTime			= PR_FALSE;#if defined(PR_LOGGING)        gSOCKSLog = PR_NewLogModule("SOCKS");#endif    }        LOGDEBUG(("Entering nsSOCKSIOLayerAddToSocket()."));        PRFileDesc *	layer;    PRStatus	rv;        layer = PR_CreateIOLayerStub(nsSOCKSIOLayerIdentity, &nsSOCKSIOLayerMethods);    if (! layer)    {        LOGERROR(("PR_CreateIOLayerStub() failed."));        return NS_ERROR_FAILURE;    }        nsSOCKSSocketInfo * infoObject = new nsSOCKSSocketInfo();    if (!infoObject)    {        // clean up IOLayerStub        LOGERROR(("Failed to create nsSOCKSSocketInfo()."));        PR_DELETE(layer);        return NS_ERROR_FAILURE;    }        NS_ADDREF(infoObject);    infoObject->Init(socksVersion, proxyHost, proxyPort);    layer->secret = (PRFilePrivate*) infoObject;    rv = PR_PushIOLayer(fd, PR_GetLayersIdentity(fd), layer);        if (NS_FAILED(rv))    {        LOGERROR(("PR_PushIOLayer() failed. rv = %x.", rv));        NS_RELEASE(infoObject);        PR_DELETE(layer);        return NS_ERROR_FAILURE;    }        *info = infoObject;    NS_ADDREF(*info);    return NS_OK;}