Re: Full-duplex communication

From: Date: Thu, 23 May 2002 22:33:28 +0000
Subject: Re: Full-duplex communication
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-84365@lists.php.net to get a copy of this message
On Thu, 2002-05-23 at 23:59, Stig S. Bakken wrote: > On Thu, 2002-05-23 at 14:39, Vinod Panicker wrote: > > Hi Faisal, > > > > Tx for ur thoughts... > > > > On Thu, 23 May 2002 Faisal Nasim wrote : > > >Hi, > > > > > >Why not simply use Apache to forward to the request to your PHP > > >script or 'other program' and deploy threads for whatever > > >process > > >you want to run in the background? > > > > I dont want to run anything else in the background. All i want to > > do is to have the ability to send some data to the client when it > > is required by the system. > > Try making a size 0 frame with a php script inside that output complete > chunks of javascript (script start/end tags). I hit "send" a bit early :-) The trick is something like this page A is a <frameset rows="*,0"> where the 0-height frame is a php-driven request that does not stop, ala this: <head><title>control page</title></head> <?php while (true) { print "<script language=javascript>\n"; print "top.mainframe.document.write('tick<br>');\n"; print "</script>\n"; flush(); sleep(1); } ?> I've used this trick to implement progress bars and such for big database operations, it works like a charm. - Stig

« previous php.dev (#84365) next »