关于ios 网络连接的问题
我在做一个聊天app,
从wifi切换到蜂窝数据,网络正常可以访问到服务器,
从蜂窝切换到wifi的时候也正常可以访问到服务器,
但当使用蜂窝数据并启用3G的话,会出现长时间连不到服务器,最终也能连接上(我想切换后短时间内就能连接上, 因为时间过长给用户的感觉不好。)
下面是输出网络的切换3G后的网络状态,
SCNetworkReachabilityFlags reachabilityFlags = 0;
BOOL reachbilityState = SCNetworkReachabilityGetFlags(reachability, &reachabilityFlags);
NSLog(@"reachbilityState %i",reachbilityState);
NSLog(@"reachabilityFlags %i",reachabilityFlags);
NSLog(@"kSCNetworkReachabilityFlagsReachable %i",kSCNetworkReachabilityFlagsReachable);
NSLog(@"kSCNetworkReachabilityFlagsTransientConnection %i",kSCNetworkReachabilityFlagsTransientConnection);
NSLog(@"kSCNetworkReachabilityFlagsConnectionRequired %i",kSCNetworkReachabilityFlagsConnectionRequired);
NSLog(@"kSCNetworkReachabilityFlagsConnectionOnTraffic %i",kSCNetworkReachabilityFlagsConnectionOnTraffic);
NSLog(@"kSCNetworkReachabilityFlagsInterventionRequired %i",kSCNetworkReachabilityFlagsInterventionRequired);
NSLog(@"kSCNetworkReachabilityFlagsConnectionOnDemand %i",kSCNetworkReachabilityFlagsConnectionOnDemand);
NSLog(@"kSCNetworkReachabilityFlagsIsLocalAddress %i",kSCNetworkReachabilityFlagsIsLocalAddress);
NSLog(@"kSCNetworkReachabilityFlagsIsDirect %i",kSCNetworkReachabilityFlagsIsDirect);
NSLog(@"kSCNetworkReachabilityFlagsIsWWAN %i",kSCNetworkReachabilityFlagsIsWWAN);
reachbilityState 1
2013-04-25 17:15:04.047 reachabilityFlags 262147
2013-04-25 17:15:04.048 kSCNetworkReachabilityFlagsReachable 2
2013-04-25 17:15:04.049 kSCNetworkReachabilityFlagsTransientConnection 1
2013-04-25 17:15:04.051 kSCNetworkReachabilityFlagsConnectionRequired 4
2013-04-25 17:15:04.052 kSCNetworkReachabilityFlagsConnectionOnTraffic 8
2013-04-25 17:15:04.057 kSCNetworkReachabilityFlagsInterventionRequired 16
2013-04-25 17:15:04.058 kSCNetworkReachabilityFlagsConnectionOnDemand 32
2013-04-25 17:15:04.059 kSCNetworkReachabilityFlagsIsLocalAddress 65536
2013-04-25 17:15:04.061 kSCNetworkReachabilityFlagsIsDirect 131072
2013-04-25 17:15:04.062 kSCNetworkReachabilityFlagsIsWWAN 262144
请问 状态262147 是什么状态,我该怎么做才能让app更快的连接上服务器。 谢谢
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论