This is a discussion on Server Process within the PHP General forums, part of the PHP Programming Forums category; Just a follow up to my post about running an application server side and the introduction of sockets. My application ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Just a follow up to my post about running an application server side and the
introduction of sockets. My application is really just to modify a series of images on the server and combine them into a collage of images as a single file name. So I just say go and wait for it to build the final file, then it is done. So in this case are sockets an advantage? I really just want to start the application and let it go, without transferring data back and forth between PHP and the app. Any more help would be great. Cheers, Nathan |
|
|||
|
On 8/13/07, Nathan Wallis <nwallis@ncable.net.au> wrote:
> Just a follow up to my post about running an application server side and the > introduction of sockets. > > > My application is really just to modify a series of images on the server and > combine them into a collage of images as a single file name. So I just say > go and wait for it to build the final file, then it is done. > > > So in this case are sockets an advantage? I really just want to start the > application and let it go, without transferring data back and forth between > PHP and the app. > > > Any more help would be great. > > Cheers, > > Nathan > Yes, Sockets are still an advantage, IF you use them correctly, and use the script behind it correctly. Each program does some things at startup, like loading DLLs if they weren't loaded already, copying program into memory etc. which all take resources, and when you run the program as a service with access through sockets, the program would run forever, but doesn't need to startup each time. Tijnema -- Vote for PHP Color Coding in Gmail! -> http://gpcc.tijnema.info |
|
|||
|
On Mon, August 13, 2007 4:37 am, Nathan Wallis wrote:
> Just a follow up to my post about running an application server side > and the > introduction of sockets. > > My application is really just to modify a series of images on the > server and > combine them into a collage of images as a single file name. So I > just say > go and wait for it to build the final file, then it is done. > > So in this case are sockets an advantage? I really just want to start > the > application and let it go, without transferring data back and forth > between > PHP and the app. > > Any more help would be great. Who is doing the waiting, and when, and just how long will they need to wait?... I suspect you are over-engineering this, and could just write a single script to do the collaging and not even have it ever be in a file. <img src="collage.php" /> <?php //collage.php //something not unlike this: $files = array('1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg'); $image = imagecreatetruecolor(600, 400); reset($files); for ($column = 0; $column < 3; $column++){ for ($row = 0; $row < 2; $row++){ $img = imagecreatefromjpg('/full/path/to/images/' . next($files)); imagecopyresampled($image, $img, $column * 200, $row * 200, 0, 0, 200, 200, imagesx($img), imagesy($img)); } } header("Content-type: image/jpeg"); imagejpeg($image); ?> We can't really tell you if you should use a daemon, a cache, or whatever, unless you tell us more about the Big Picture of your application. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? |
![]() |
| Thread Tools | |
| Display Modes | |
|
|