弯曲3的netconnection - 如何设置超时?
-
20-09-2019 - |
题
使用Flex 3,如何设置一个超时一个NetConnection?
代码示例:
nc=new NetConnection();
nc.addEventListener (NetStatusEvent.NET_STATUS,checkConnect);
rtmpNow="rtmpe://host/test/test1";
nc.connect(rtmpNow,fuid,gameName);
解决方案
除非你打算等待NetConnection.Connect.Failed,我相信你已经设置自己的超时检查。
使用Timer对象,你可以在Timer.TIMER_COMPLETE检查是否你已经在你的checkConnect功能获得了值为NetConnection.Connect.Success。
想不出另一种方式来做到这一点。
不隶属于 StackOverflow