Streaming data to the client whilst allowing the client to work

J

John

Hi all,

I have an (well, what I think to be, at least) interesting question:
Is it possible to stream data down to the client and, after a certain amount
of data has been streamed, allow the client to begin interacting with that
data whilst still streaming data down?

Also, if it is possible, how would one go about coding this? Would some sort
of predfined bit of streaming be finished and notify the client (i.e. some
form of Javascript call after each section of streaming has completed)

Could someone please send me either some coding examples to begin with as a
starter or, more importantly, a few links to sites that have successfully
implemented this?

Thanks a lot in advance

Regards
John.
 
M

mathlec

Basicaly, streaming is not something we do in a web situation.
The server provide static version of pages wich are then shown to the
user by a browser..

I often see the web like a printer. You can manipulate the source, but
once it's printed.. it's over. If you want to move something, you have
to redo the source.

But if you're ready to read and do some research.. start by looking for
XmlHTTP and how it's used.

You may find this
(http://support.microsoft.com/default.aspx?scid=kb;en-us;893659)
article -pretty- interesting.
 
L

Lucas Tam

John said:
I have an (well, what I think to be, at least) interesting question:
Is it possible to stream data down to the client and, after a certain
amount of data has been streamed, allow the client to begin
interacting with that data whilst still streaming data down?

Yes... it's called AJAX, Javascript Remoting, or Client Side Callbacks.

: )
 
J

John Rivers

oh yes

you can bodge up callbacks

by coding an img element to load a new image
passing parameters in the url

voila!

two way communication!

watch out if you are using single threaded session object though
cos you won't get the requests

it is the same technique spammers use to determine if your email
is real

<img src="http://[email protected]" width="0"
height="0"/>

that is why preview pane in outlook is fraught with danger!
as soon as the email is previewed they know a human looked at it
 
J

John Rivers

One simple technique I have used (first saw it in gifwizard.com in
1994)
is to output the html page to the browser

then open a
<script language="javascript">

and now you can keep streaming javascript commands
which can interact with dhtml dom and do anything

gifwizard used it to update a statusbar

<table id="statusBar" style="width:0px;" bgcolor="#ff0000">
<tr>
<td></td>
</tr>
<table>

statusBar.style.width = 10; //or something
statusBar.style.width = 20; //or something
statusBar.style.width = 30; //or something
etc.

although i usually use functions with very small names
like "s(1);" to keep the stream small

as long as you don't response.end the client will
keep an http connection open for a very long time
indeed

you can even clear the document and send
a new page if you want ... it works fine

obviously it might stress out the client
if the stream becomes too big over time!

hope that helps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,052
Latest member
LucyCarper

Latest Threads

Top