Macromedia Flash Server - Unplug wire and onDisconnect

This is Interesting: Free IT Magazines  
Home > Archive > Macromedia Flash Server > June 2006 > Unplug wire and onDisconnect





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Unplug wire and onDisconnect
Daniil Tutubalin

2006-06-23, 1:11 pm

FlashComm 1.5

When user closes flash movie (or browser window containing flash movie),
event application.onDisconnect is fired.

But if user unplugs network wire, then no event fired.
If user plug wire back, in fact his connection is lost (he cannot send
messages, call methods, etc), but FlashComm application still thinks that
client is connected.

Is there any way to solve such situation?

I have only one idea - ping every client once in minute (something like
client.call("ping")) and wait response (client must do something like
nc.call("pong")).

But is there any more beautiful solutions?

________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Jay Charles

2006-06-23, 1:11 pm

Yup...

What I like to do is set up a shared object on the server, and add a
property for each client as they connect. I then have each client call a
server side method every 5 seconds that sets the value of the user's SO
property to true.

Every 10 seconds, I run a function on the server that loops through the
SO and checks the value for each user. If the value is true, it means
the client checked in within the last 10 seconds (still there), and the
value is set to false. If the value is already false, it means the
client hasn't updated, and is gone.

You could also do this with an array if you don't have other uses for
the sharedObject.

Incidentally, ping won't work if the client is behind a router or
network server. The ping always seems to be returned, even if the client
is gone.

-Jay

-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org] On Behalf Of Daniil
Tutubalin
Sent: Friday, June 23, 2006 5:06 AM
To: flashcomm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
Subject: [FlashComm] Unplug wire and onDisconnect

FlashComm 1.5

When user closes flash movie (or browser window containing flash movie),
event application.onDisconnect is fired.

But if user unplugs network wire, then no event fired.
If user plug wire back, in fact his connection is lost (he cannot send
messages, call methods, etc), but FlashComm application still thinks
that
client is connected.

Is there any way to solve such situation?

I have only one idea - ping every client once in minute (something like
client.call("ping")) and wait response (client must do something like
nc.call("pong")).

But is there any more beautiful solutions?

________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




________________________________________
_______
FlashComm-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com