超时重连增加条件编译

This commit is contained in:
lishuo 2021-11-23 09:33:05 +08:00
parent d5ea26f15c
commit 68688c9daf

View File

@ -95,12 +95,14 @@ namespace Assets.Scenes.Ride.Scripts
{ {
onlineUserHelper.SetOnlineUser(new List<ReceiveMsgModel>()); onlineUserHelper.SetOnlineUser(new List<ReceiveMsgModel>());
} }
#if UNITY_IOS
//超过5s没收到消息断开重连一次 //超过5s没收到消息断开重连一次
if ((now - LastActiveTime).TotalSeconds > 5) if ((now - LastActiveTime).TotalSeconds > 5)
{ {
LastActiveTime = now; LastActiveTime = now;
_udpService.Disconnect(); _udpService.Disconnect();
} }
#endif
if (now.Second % 20 == 0) if (now.Second % 20 == 0)
{ {
//LastActiveTime = now; //LastActiveTime = now;