Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Conversation

iMickChen
Copy link

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 .

iMickChen and others added 2 commits May 15, 2018 16:49
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 .
@iMickChen
Copy link
Author

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 .

@dustturtle
Copy link
Owner

which user case you want to handle? does it really exists or you meet with it? @iMickChen
I am thinking about it

@dustturtle
Copy link
Owner

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.

@dustturtle dustturtle closed this May 17, 2018
@iMickChen
Copy link
Author

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.

@iMickChen
Copy link
Author

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.
en about first problem is my company Test Engineer find and submit bugs for me, I have actually repeat that problem in my app and the RealReachablity demo

@dustturtle
Copy link
Owner

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.

@iMickChen
Copy link
Author

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants