Groups | Blog | Home
all groups > macromedia flash flash remoting > may 2004 >

macromedia flash flash remoting : Is it possible to check a connection is active?



Lucent Oculi
5/7/2004 8:53:35 AM
Hi All,

All the tutorials for flash remoting put the Net connection code in a
"run once" section at the beginning of the movie. This works fine for me but in
the event of the connection being lost how would you reconnect?

Does the connection re establish itself?
Can you check if the connection is there and then try to reconnect?

Any help would be much appreciated

Regards
Phill
CF_Admin
5/7/2004 9:20:58 AM
if (isGatewayOpen == null) {
// do this code only once
isGatewayOpen = true;

NetServices.setDefaultGatewayUrl("http://127.0.0.1:8500/flashservices/gateway");
gatewayConnnection = NetServices.createGatewayConnection();
register = gatewayConnnection.getService("poetry.login", this);
}

As you say the above code checks once. Someone correct me if I'm wrong. But
you should only need to check the gateway once. I don't believe it is an active
connection, like you might have with some client server applications on a
private network. The Internet is stateless, so it connects every time it needs
to send or retrieve data. Once it has established where the gateway is, it
doesn't need to do that again... during that session. But since this is client
side, each client will run that once, during each session. So I don't think
it's a concern. Did I understand your question? Did I answer your question? ;^)
Lucent Oculi
5/10/2004 2:35:11 PM
Thanks CF_admin,


AddThis Social Bookmark Button