Results 1 to 10 of 10
- 04-17-2010, 01:11 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 5
- Rep Power
- 0
monitor the progress of sending a file to client
I am using a Java module in Wowza server (rtmp protocol) to send a bytearray
to the client application (AS3).
I need to Monitor the download of this file and the client application(AS3) does not allow it: There is a known bug in AS3 that prevents access to the Loader class when uploading certain files, if the loading of the file has not completed.
Would it be possible for the server side Java script to somehow send the client some information about the "sending" of the file ?
Does someone have any other idea how I "help" the client get progress information ?
The Java wowza module is using the following line to send the bytearray:
I will be grateful even for a general answer such as: Yes, it can be done and you should use the following mechanism, etc.Java Code:sendResult(client, params, AMFDataByteArray.wrap(fileBytes));
Last edited by adumi; 04-17-2010 at 01:33 PM.
- 04-19-2010, 04:48 AM #2
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
Is the server provide an echo?
- 04-22-2010, 12:43 AM #3
Member
- Join Date
- Apr 2010
- Posts
- 5
- Rep Power
- 0
Thank you Webuser for commenting, and sorry for delaying in response, I took some time to study your idea on Echo server over tcp/ip.
Suppose I can arrange for an echo server, how can I use it to send the client information about the progress of transferring the file, please ?
Thank you for your assistance !
- 04-22-2010, 01:48 AM #4
Senior Member
- Join Date
- Mar 2010
- Posts
- 266
- Rep Power
- 4
you could try to have override AMFData class to take an input stream instead of a byte array, override the stream so you're manually reading from the file and can keep track of how many bytes were requested...
- 04-22-2010, 10:39 AM #5
Member
- Join Date
- Apr 2010
- Posts
- 5
- Rep Power
- 0
Thanks Iluxa, for your comment, I appreciate your assistance very much.
Do you mean I shoud try to do that with AS3 or AS2 ? or with another language on client-side ?
- 04-23-2010, 05:26 AM #6
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
Oh, wellcome back )
It is quite easy. As soon as you upload a file you should make your server to send a message back like a 1/0 for example. Until the echo replies set your client JProgressBar or something keep active. Since you get reply stop your JProgressBar )
echo server is much popular thing as for Java. I recomend a short code example. watch it
Echo ServerLast edited by Webuser; 04-23-2010 at 05:28 AM.
If my answer helped you. Please click my "REP" button and add a comment
Have a Good Java Coding :)
- 04-23-2010, 11:45 AM #7
Member
- Join Date
- Apr 2010
- Posts
- 5
- Rep Power
- 0
Hi Webuser,
Many thankls for for the code !
I`d like to present a real progress bar, with precentage.
The Thing is that unless I miisunderstand you (and this is quite probable) the echo server can supply only the start and stop events and not a simulatneous continuous read out of the ammounts of bytes loaded. This 2 event option is already available to me in AS3, despite the bug.
Do you think there is any way to make an Echo server actually report progress, no tonly start/End events ?
- 04-23-2010, 06:51 PM #8
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
I think you can simply use a non percent JProgressBar or if you really want to see % or something add a timer simulate some progress )
actually the problem you describe is much familiar ) But if the upload was aborted your server echo should report it )
So there should be noticed 3 upload steps
1. Start upload
2. Upload can be aborted (an error)
3. success/unssuccess server echoIf my answer helped you. Please click my "REP" button and add a comment
Have a Good Java Coding :)
- 04-23-2010, 07:08 PM #9
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
And moreover you can use some additional tricky formula to time your precentage till you wait an echo...
Here is a short pseudocode
lib java.util.Timer
I hope you got the idea )Java Code:percentage += second; progbar.setValue(percentage); //got echo progbar.setValue(100);
If my answer helped you. Please click my "REP" button and add a comment
Have a Good Java Coding :)
- 04-23-2010, 09:55 PM #10
Member
- Join Date
- Apr 2010
- Posts
- 5
- Rep Power
- 0
Thanks Webuser,
You know, If I get stuck eventually and lose all other hope this is what I`ll do.
I can actually get even a rough estimate of the user`s bandwidth speed which will enable me to allow for a `guessed` progress bar.
I`ll still make some more attempts to get the real thing, meanwhile, thanks for your help so far...
Similar Threads
-
Sending Text File --- Server-To-Client
By nigamsir in forum NetworkingReplies: 1Last Post: 03-08-2010, 03:45 PM -
Sending a File from Server to Client and saving the file to Clients computer
By al_Marshy_1981 in forum NetworkingReplies: 8Last Post: 02-18-2010, 12:54 PM -
Sending image file over serversocket to browser client
By maheshsk in forum Web FrameworksReplies: 1Last Post: 12-10-2009, 02:39 PM -
How to use timer to monitor lengthy loop progress
By JotaPe in forum New To JavaReplies: 7Last Post: 06-26-2009, 06:14 AM -
Sending a .Doc file from client to a server through socket
By amita_k29 in forum NetworkingReplies: 1Last Post: 02-10-2009, 09:16 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks