I think it's worth trying, because trying to read
an integer this way won't waste any CPU cycles -
Flash/Flex probably run select() or poll() internally
and just sleep - until anything arrives over the socket.

(Versus trying to pull anything every 30 seconds -
that will cost you CPU and also feel delayed).

And whenever an integer arrives, then you could
use that number to indicate how many records have 
changed at your backend, so that you can use it to 
provide feedback on the progress to the user
while fetching the updated data over HTTP.

Regards
Alex

--- In flexcoders@yahoogroups.com, dorkie dork from dorktown 
<dorkiedorkfromdorkt...@...> wrote:
>
> good idea :) that'll work
> 
> On Mon, Aug 16, 2010 at 2:42 AM, Alexander Farber <
> alexander.far...@...> wrote:
> 
> >
> >
> > An idea: you could open a socket connection
> > (because of corporate proxies best would be the port 80)
> > and try to read an integer:
> >
> > private function handleTcpData(event:Event):void {
> > while(_socket.bytesAvailable) {
> > try{
> > var i:int = _socket.readInt();
> > fetchHttpData(i);
> > }catch(e:Error){
> > // incomplete integer, will be read by another handleTcpData call
> > return;
> > }
> > }
> > }
> >
> > and whenever an integer arrives from your backend,
> > your client could read the whole data over HTTP.
> >

Reply via email to