Get size of response...

Post here your questions about the HTML5 / JavaScript for SFS2X

Moderators: Lapo, Bax

Devon
Posts: 41
Joined: 12 Apr 2011, 16:18

Get size of response...

Postby Devon » 16 Jan 2013, 08:30

I'm creating a whiteboard and keeping track of all of the line segments drawn. As you can imagine, this would build up over time and may reach upwards of 1MB before the board is cleared. So, new users who join the room will have to download 1MB of data to view the current state. While most peoples internet connections can handle 1MB downloads in very little time, I'd be nice to be able to show a progress bar for those with slightly slower connections...

How would I go about getting the response, it's overall size, and how much has been received thus-far?

Thanks,
- Devon
User avatar
Lapo
Site Admin
Posts: 21276
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Get size of response...

Postby Lapo » 16 Jan 2013, 09:55

Hi Devon,
I would suggest to implement a "sampling strategy" for your whiteboard so that segments are slightly simplified in order to reduce the mass of data you're transferring. 1MB of data seems very much, way too much.

If you sample the drawing at, say, 200ms you will grab less data but still retain the shapes. Without such a sampling mechanism you're going to generare thousands of small segments for each minute change in direction of the drawing hand.

As regards the size of the response it's not doable, sorry.
Lapo
--
gotoAndPlay()
...addicted to flash games
Devon
Posts: 41
Joined: 12 Apr 2011, 16:18

Re: Get size of response...

Postby Devon » 16 Jan 2013, 10:27

Unfortunately, it's more of an art board than a white board so precision and fluency is important. I may implement some point smoothing to reduce some clutter but overall I need most of the data.

Do you have any plans for adding the ability to create progress bars in the future?

I suppose in the mean-time, I could replicate the network functions by segmenting the packet data into smaller parts or frames myself (on the server), sending them individually to the client, and keeping track of what the client has received.

Return to “SFS2X HTML5 / JavaScript API”

Who is online

Users browsing this forum: No registered users and 3 guests