FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Output status during processing
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Output status during processing [message #179533 is a reply to message #179530] Mon, 05 November 2012 12:40 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Sun, 04 Nov 2012 13:52:35 -0800, Scott Johnson wrote:

> I could use AJAX to load the file and then process it in the background
> sending status points as it goes through AJAX.

Back up a step.

The server can't "send" status updates to the browser using ajax in the
normal case, rather the browser would request "request" status updates
from the server, usually in relation to some browser event (which might
be a javascript timer timeout, or the user clicking a "get update" button
or link).

Ajax, which is built on the http request / response, which is in turn
built on a tcp/ip connection, is not a technology which generally allows
the server to push unsolicited data to the browser, rather it is a
technology that allows the browser to make requests to the server and
receive data back without reloading the page being displayed.

Specifically, when you make an http request to a server, a tcp connection
is opened to the server. The connection is usually closed after the
server has sent the response. Making a connection to the server is easy,
because tcp/ip knows that the server is listening to http on port 80. In
the other direction, there is no official port that a browser listens out
on for a server to make a connection to it, which makes it difficult for
the server to open a connection to the browser to just send it something.

I know it may sound like a petty distinction to make, but making the
distinction helps you keep it clear in your mind how it all fits
together, and in the concept of php running behind a web-server, the
context is generally servicing and responding to requests from the
browser, not pushing data to the browser.

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: adding a method to a built-in class ?
Next Topic: Help required with UPDATE columns
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Dec 20 14:39:01 GMT 2024

Total time taken to generate the page: 0.04411 seconds