Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > progress messages from server

Reply
Thread Tools

progress messages from server

 
 
Roedy Green
Guest
Posts: n/a
 
      10-23-2003
A customer of mine has asked how you best arrange for progress
messages from a server for something that takes a long time to
complete if you use plain HTTP.

Do you just keep sending HTTP packets back to repaint one HTML frame,
or is there something more to it?

We was going to have me write some client side code to manage it, but
he wanted this to work also in very old machines without decent Java,
so I though the thin approach might work better.

Is there a tutorial that explains the HTTP protocol on such matters?

Likely the server side will NOT be Java.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
 
 
 
bm
Guest
Posts: n/a
 
      10-23-2003
Either you are going to poll the server every so often to find if the job
is done that means you have to implement presistent sessions using
cookies or session ids. This is not a good approach. Every client-server
book would tell you not to poll the server.

Or, have the server to keep a presistent session, same as the other choice,
and update the status by sending the client http messages which means you
have to do multi-threading on the server code. So much coding and change
for such a small feature. Not worth the effort.

Or, make your life easier. There are too many unknown variables here to now
how long each operation would take. How are you going to make a progress
bar anyway? Unless you set the progress based on the number of tasks that
need
to be accomplished to finish the job. So either partition the job and send
each
task to the server separately and show the progress that way in the client.
Or
if there is only one task to do, then have a simple flashing text saying
'Please wait for such and such task to complete. This operation
may take so and so much time. Please be patient. If the
operation takes a long time, click the link below
http://..... '
Simple, easy and elegent.

hope this saves you a lot of grief.


"Roedy Green" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> A customer of mine has asked how you best arrange for progress
> messages from a server for something that takes a long time to
> complete if you use plain HTTP.
>
> Do you just keep sending HTTP packets back to repaint one HTML frame,
> or is there something more to it?
>
> We was going to have me write some client side code to manage it, but
> he wanted this to work also in very old machines without decent Java,
> so I though the thin approach might work better.
>
> Is there a tutorial that explains the HTTP protocol on such matters?
>
> Likely the server side will NOT be Java.
>
> --
> Canadian Mind Products, Roedy Green.
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      10-23-2003
On Thu, 23 Oct 2003 05:46:29 GMT, "bm" <(E-Mail Removed)>
wrote or quoted :

>Or, make your life easier. There are too many unknown variables here to now
>how long each operation would take. How are you going to make a progress
>bar anyway? Unless you set the progress based on the number of tasks that
>need
>to be accomplished to finish the job. So either partition the job and send
>each
>task to the server separately and show the progress that way in the client.


The progress is a series of status messages.
--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
bm
Guest
Posts: n/a
 
      10-23-2003
If you want the business logic strictly in the server, then do the
tasks in the server and send a status message in HTML to the
client after completing each individual task. A servlet with
session enabled would do the trick.

Otherwise, put the logic in the client using multiple calls to the
server. I think this approach would be more complicated. You
have to think about synchronizing session and transaction logic
between server and client.


"Roedy Green" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Thu, 23 Oct 2003 05:46:29 GMT, "bm" <(E-Mail Removed)>
> wrote or quoted :
>
> >Or, make your life easier. There are too many unknown variables here to

now
> >how long each operation would take. How are you going to make a progress
> >bar anyway? Unless you set the progress based on the number of tasks that
> >need
> >to be accomplished to finish the job. So either partition the job and

send
> >each
> >task to the server separately and show the progress that way in the

client.
>
> The progress is a series of status messages.
> --
> Canadian Mind Products, Roedy Green.
> Coaching, problem solving, economical contract programming.
> See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.



 
Reply With Quote
 
Michael Borgwardt
Guest
Posts: n/a
 
      10-24-2003
Roedy Green wrote:
> A customer of mine has asked how you best arrange for progress
> messages from a server for something that takes a long time to
> complete if you use plain HTTP.
>
> Do you just keep sending HTTP packets back to repaint one HTML frame,
> or is there something more to it?


It's a bit of a hack, but it should work: keep one HTTP connection
for a page that's not visible (e.g. to a 0x0 pixel frame)
open all the time by steadily sending a little data through it so that
it does not time out. When you want to display a status message,
send a javascript command that updates another frame.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning progress messages during an async process RSH ASP .Net 0 12-31-2007 03:40 PM
Partition Magic - meaning of progress messages? Tim Computer Support 9 09-29-2006 06:22 PM
i sent 2 messages about double messages monique Computer Support 0 11-27-2004 07:18 PM
will all these messages cause a problem . I am a new subscriber and my computer is downloading 100,000 messages. Will this cause any kind of a problem with my ability to store other items?? Camille White Camille White Computer Support 9 11-08-2004 01:13 AM
Progress bar to show the progress of a task Charlie Zhang Java 3 08-16-2004 05:53 PM



Advertisments