1

Using flex 3, how do i set a timeout for a NetConnection?

code sample:

 nc=new NetConnection();
 nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
 rtmpNow="rtmpe://host/test/test1";         
 nc.connect(rtmpNow,fuid,gameName);
ufk
  • 30,912
  • 70
  • 235
  • 386

1 Answers1

3

Unless you plan to wait for a NetConnection.Connect.Failed, I believe you have to setup your own timeout checks.

Using a Timer object, you can check upon Timer.TIMER_COMPLETE whether or not you've received a NetConnection.Connect.Success in your checkConnect function.

Can't think of another way to do this.

Aaron
  • 4,634
  • 1
  • 27
  • 43