Can't connect to a local apache installation under XAMPP on Win XP 64-bit. Help!

Question!

I'm using XAMPP v1.7 on an Win XP-64 bit machine, my Symantec AV is turned off as is my Windows Firewall, and I can't connect to localhost from a browser.

I originally had these errors:
[Wed Jan 07 16:24:55 2009] [error] (OS 10038)An operation was attempted on something that is not a socket. : Child 2716: Encountered too many errors accepting client connections. Possible causes: dynamic address renewal, or incompatible VPN or firewall software. Try using the Win32DisableAcceptEx directive

These errors went away after I added the Win32DisableAcceptEx directive to httpd.conf, but the net result remains the same: no joy.

Now, I get these errors:
[Wed Jan 07 16:40:15 2009] [notice] Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11
OpenSSL/0.9.8i mod_autoindex_color PHP/5.2.8 configured -- resuming normal operations
[Wed Jan 07 16:40:15 2009] [notice] Server built: Dec 10 2008 00:10:06
[Wed Jan 07 16:40:15 2009] [notice] Parent: Created child process 5916
[Wed Jan 07 16:40:15 2009] [notice] Disabled use of AcceptEx() WinSock2 API
[Wed Jan 07 16:40:15 2009] [notice] Digest: generating secret for digest authentication
... [Wed Jan 07 16:40:15 2009] [notice] Digest: done
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Child process is running
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Acquired the start mutex.
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Starting 250 worker threads.
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Listening on port 443.
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Listening on port 80.
[Wed Jan 07 16:40:15 2009] [error] (OS 10038)An operation was attempted on something that
is not a socket. : Too many errors in select loop. Child process exiting.
[Wed Jan 07 16:40:15 2009] [notice] Child 5916: Exit event signaled. Child process is ending.
[Wed Jan 07 16:40:16 2009] [notice] Child 5916: Released the start mutex
[Wed Jan 07 16:40:17 2009] [notice] Child 5916: All worker threads have exited.
[Wed Jan 07 16:40:17 2009] [notice] Child 5916: Child process is exiting
[Wed Jan 07 16:40:17 2009] [notice] Parent: child process exited with status 0 -- Restarting.
[Wed Jan 07 16:40:17 2009] [notice] Digest: generating secret for digest authentication ...
[Wed Jan 07 16:40:17 2009] [notice] Digest: done

And, apache seems to be crashing (Windows tells me so, and I can see the crash in the system events.)

I'm a n00b to apache, but need to get this running. Ideas? Marcus

By : codemeit


Answers

Using the more functional style forEach method on the Array class avoids this problem. This has been mentioned already but I'll expand on it here.

imageList.forEach( function ( item:MovieClip, index:int, list:Array) {
    // add your listener with closure here
})

Using this method, the function passed into the forEach defines a new scope each iteration. now you can add a closure inside this scope and it will remember each instance as you want.

On a related note:

Typing those 3 arguments the whole time is a pain so... You can also make that less / more ugly with an adaptor function:

// just give me the item please
imageList.forEach ( itrAdpt( function ( image: ImageData ) {
    // add your listener with closure here
}))

// give me the item and it's index
imageList.forEach ( itrAdpt( function ( image: ImageData, index:int ) {
    // add your listener with closure here
}))

// give me the item, index and total list length
imageList.forEach ( itrAdpt( function ( image: ImageData, index:int, length:int ) {
    // add your listener with closure here
}))

where itrAdpt is a (possibly global) function defined something like:

public function itrAdpt(f: Function): Function
{
    var argAmount:int = f.length

    if (argAmount == 0)
    {
        return function (element:*, index:int, colection:*):* {
            return f(element)
        }
    }
    else if (argAmount == 1)
    {
        return function (element:*, index:int, colection:*):* {
            return f(element)
        }
    }
    else if (argAmount == 2)
    {
        return function (element:*, index:int, colection:*):* {
            return f(element, index)
        }
    }
    else if (argAmount == 3)
    {
        return function (element:*, index:int, colection:*):* {
            return f(element, index, colection.length)
        }
    }
    else
    {
        throw new Error("Don't know what to do with "+argAmount+"arguments. Supplied function should have between 1-3 arguments")
    }
}


(function() {
  var imageData = imageList[i];
  imageData.loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function() {
    // use imageData;
  });
}).apply();


This video can help you solving your question :)
By: admin