Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 01-31-2011, 04:23 PM   #1
Registered User
Join Date: Jan 2011
Posts: 1
Default Flash socket performance issue with Android

I'm writing a Flash AS3 client for a Java real time data server. The data server pumps out 10-byte CR-separated messages every 20ms, which the client is to display in real time. Everything works, except that on some platforms the data doesn't arrive smoothly, but in periodic chunks. On some of these platforms the periods are short, but on others they are surprisingly long, especially Android (which is my planned target client, of course). No data is lost, but the delay could kill the real-time favor of the system.

Some examples of period lengths (data server always hosted under OS X):

- Running in browser (Camino) on host machine: 20ms (i.e. no apparent delay)

- Running in Flash authoring system on host machine: 50ms

- Running in browser (Camino) on separate OS X machine: 16-30ms

- Running in browser (Firefox) on separate Windows 7 machine: 200ms!

- Running in native browser on Android tablet (Android 2.2 on eLocity A7 w 1GHz processor): 400ms!!!

Here are some of the things I've tried:

- Wondering if this was a CPU loading issue, I checked the frame rate. Nope: the underlying Flash movie is set to 50fps, and (simple) animations in the client displaysmoothly at that rate on all the platforms.

- Instead of waiting for the Socket's ProgressEvent.SOCKET_DATA event, I tried adding a timer that polls the socket for data every 20ms. No good: although the poll displays at 20ms intervals, most of the time there's no data waiting, so the data still appears in the same chunks.

- Wondering if TCP/IP was being "helpful" by grouping the data into the chunks, I added a bunch of padding to the data being sent by the Java server to make the data seem more "urgent". This sped up the Win7 client substantially (to about 40ms periods), but did nothing on the other platforms (e.g. Android).

- Wondering if my server was bunching the data, I fired up Wireshark on my host while it was talking to Android. Only slightly: the TCP/IP packets are departing every 20-40ms, each containing 1-2 of the original data messages.

Any ideas? Flash video plays beautifully on the Android tablet (not to mention the Win7 system), so there's no fundamendal reason why things have to be slow (although I can't tell if there are delays in the video data delivery). I'm pretty sure there aren't any "Don't Slow Things Down" flags I could set in Flash, although I'm less sure about Android.

Thanks in advance,
dtgriscom is offline   Reply With Quote
Old 09-14-2011, 11:31 AM   #2
Registered User
Join Date: Sep 2011
Posts: 1

Sorry for bumping this old thread, but did you ever find a proper solution? I'm running into the same problem using AS3 sockets on Windows 7 communicating with Javascript websockets.

A nice solution would help me tremendously. Thanks is advance .
Rengers is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump

All times are GMT. The time now is 05:26 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.