On Mon, Nov 21, 2011 at 3:34 AM, Tim Streater <tim@xxxxxxxxxxxxxxxx> wrote: > On 20 Nov 2011 at 10:36, Tommy Pham <tommyhp2@xxxxxxxxx> wrote: > > > I think you're approaching this the wrong way. > > 1) have a clear understanding of PHP - syntax, capabilities, etc. > > That's what I'm doing - gathering information about bits of PHP that I've > not used (or not used very much) before to see how my new setup could be > structured. > > > 2) have a clear understand of what you're intending to do - > > application's function/purpose, features, manageability, > > expandability, portability, etc... > > I have a clear idea about *that*. I want to figure out if it's possible to > use web sockets with a small server written in PHP to replace my current > structure of ajax + apache + processes (which I suppose it forks). I see > these benefits: > > 1) possible benefit - presumably when an ajax request arrives, a new > process is started and so PHP has to be loaded and initialised each time. > But perhaps this is in some way optimised so the PHP process is left > running and apache then just tells it to read/execute a new script. > Did you check http://php-fpm.org/ > > 2) Definite benefit - when a browser makes an ajax request to run a > script, it gets no information back until the script completes. Then it > gets all of it. I have a couple of unsatisfactory workarounds for that in > my existing structure. Websockets appears to offer a way for the browser to > receive timely information. > > > 3) understand design patterns > > I don't know what this means. > > > What your asking is practically impossible in any programming language > > akin to 'how to un-import packages in Java' or 'how to un-using > > namespace in C#'. If you don't want to use it, don't include it ;) > > I do want to use it but would like to be able to replace it with a newer > version. If there is no way to do this then that is a data point. > > And here's another question. Can a child forked by pcntl_fork() use a > socket that the parent obtained? Reading the socket stuff in the PHP doc, > there are a number of user-supplied notes hinting this might be problematic. > > -- > Cheers -- Tim > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- Shiplu Mokadd.im Follow me, http://twitter.com/shiplu Innovation distinguishes between follower and leader