File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ - (void)pingHandler:(GBPingSummary *_Nullable *_Nullable)summary error:(NSError
5555 double rtt = -99.0 ;
5656 double ttl = -99.0 ;
5757 BOOL isEnded = NO ;
58- int status = - 99.0 ;
58+ int status = PingConst_STATUS_UNKNOWN_FAILURE ;
5959
6060 if (summary != NULL && *summary != nil ) {
6161 rtt = [*summary rtt ] * MSEC_PER_SEC ;
@@ -77,8 +77,6 @@ - (void)pingHandler:(GBPingSummary *_Nullable *_Nullable)summary error:(NSError
7777 }
7878 if ([*error code ] == kCFHostErrorUnknown || [*error code ] == kCFHostErrorHostNotFound ) {
7979 status = PingConst_STATUS_UNKNOWN_HOST;
80- } else {
81- status = PingConst_STATUS_UNKNOWN_FAILURE;
8280 }
8381 isEnded = YES ;
8482 }
@@ -97,7 +95,12 @@ - (void)ping:(GBPing *)pinger didFailWithError:(NSError *)error {
9795}
9896
9997- (void )ping : (GBPing *)pinger didTimeoutWithSummary : (GBPingSummary *)summary {
100- [self pingHandler: &summary error: NULL ];
98+ self.onPing (
99+ PingConst_NO_ECHO_RTT,
100+ PingConst_NO_ECHO_TTL,
101+ PingConst_STATUS_TIMEDOUT,
102+ [summary sequenceNumber ] == self->count - 1 ? YES : NO
103+ );
101104}
102105
103106- (void )ping : (GBPing *)pinger didSendPingWithSummary : (GBPingSummary *)summary {
Original file line number Diff line number Diff line change 11{
22 "name" : " ping-react-native" ,
3- "version" : " 1.3.1 " ,
3+ "version" : " 1.3.2 " ,
44 "description" : " Ping controller for React Native app" ,
55 "author" : " RakaDoank <rakaaudira@gmail.com> (https://github.com/RakaDoank)" ,
66 "license" : " MIT" ,
You can’t perform that action at this time.
0 commit comments