-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix bug and add function #106
Conversation
1、fix in bad network condition the ping checker return fail but network status possible set to reachable while not post status change notification to users; so if user call - (ReachabilityStatus)currentReachabilityStatus function return status is not match with the app UI current show state. eg: the app shows current time is in no network condition while can send out network request. 2、add when in bad network condition ping fail two times, changed reachable status to not reachable; later network become better, if ping two times return success, we consider the network is connected and change network status to reachable and post change notification to users .
1、fix in bad network condition the ping checker return fail but network status possible set to reachable while not post status change notification to users; so if user call - (ReachabilityStatus)currentReachabilityStatus function return status is not match with the app UI current show state. eg: the app shows current time is in no network condition while can send out network request. |
which user case you want to handle? does it really exists or you meet with it? @iMickChen |
I got your point. Thanks a lot! But I think ping success once we will mark "connection ok", double check not needed. I will commit the codes. |
en, I have meet times, when the network condition is badly and unstable , the first ping return fail then we start next ping to confirm, next ping callback and return success, we call FSMEgine - (NSInteger)receiveInput:(NSDictionary *)dic function may change current network status to reachable but if when previous network status is unreachable, on this condition if (!isSuccess) return false we do not have chance post the network has changed notification. so we can see the app UI is still shows current is no network,actually can send network request success. |
I think when ping two times result change network status to unreachable, latter network become better the first time ping success we mark "connection ok" is not convenient, I thinks if next ping is still success we can mark the networking is connected. double check can avoid network fluctuation cause frequently post notification. |
Ping check maybe too strict for status report, so I introduce the double check to reduce this situation. From this sight of view, I will not force the double check when first ping success. |
Double ping success check is only affect current status is unReachable and localConnection is connected. if not force double check, return status is only check one time. the first ping success like localConnection local connected call back. the next ping like to make sure your reachability is "Real" |
1 changed file
1、fix in bad network condition the ping checker return fail but network status possible set to reachable while not post status change notification to users; so if user call - (ReachabilityStatus)currentReachabilityStatus function return status is not match with the app UI current show state. eg: the app shows current time is in no network condition while can send out network request.
2、add when in bad network condition ping fail two times, changed reachable status to not reachable; later network become better, if ping two times return success, we consider the network is connected and change network status to reachable and post change notification to users .