Commit f530f5e7 by GuoJianPeng

update

parent b8790e38
...@@ -56,22 +56,12 @@ ...@@ -56,22 +56,12 @@
-(void)pingService:(ASPingService *)service singlePingTimeout:(uint16_t)seq -(void)pingService:(ASPingService *)service singlePingTimeout:(uint16_t)seq
{ {
if(!_businessHostList){return;} if(!_businessHostList){return;}
NSInteger index = [_businessHostList indexOfObject:service.targetHost]; [self _handleErrorPingCase:service];
if(index==NSNotFound){
return;//在处理www.baidu.com
}
[_pingingHostList removeObject:service.targetHost];
[self.delegate didGotBusinessServiceState:false host:service.targetHost hostIndex:index millionSeconds:0];
} }
-(void)pingService:(ASPingService *)service singlePing:(uint16_t)seq tmporaryErrorHappens:(NSError *)error -(void)pingService:(ASPingService *)service singlePing:(uint16_t)seq tmporaryErrorHappens:(NSError *)error
{ {
if(!_businessHostList){return;} if(!_businessHostList){return;}
NSInteger index = [_businessHostList indexOfObject:service.targetHost]; [self _handleErrorPingCase:service];
if(index==NSNotFound){
return;//在处理www.baidu.com
}
[_pingingHostList removeObject:service.targetHost];
[self.delegate didGotBusinessServiceState:false host:service.targetHost hostIndex:index millionSeconds:0];
} }
- (void)pingService:(ASPingService*)service stopWithError:(NSError*_Nullable)error successPingCount:(NSInteger)successPingCount - (void)pingService:(ASPingService*)service stopWithError:(NSError*_Nullable)error successPingCount:(NSInteger)successPingCount
{ {
...@@ -80,10 +70,20 @@ ...@@ -80,10 +70,20 @@
//开始业务ping //开始业务ping
_pingingHostList = _businessHostList.mutableCopy; _pingingHostList = _businessHostList.mutableCopy;
_pingService.pingCount = 1; _pingService.pingCount = 1;
}else{
[self _handleErrorPingCase:service];
} }
[self _readHostAndPing]; [self _readHostAndPing];
} }
- (void)_handleErrorPingCase:(ASPingService*)service
{
NSInteger index = [_businessHostList indexOfObject:service.targetHost];
if(index==NSNotFound){
return;//在处理www.baidu.com
}
[_pingingHostList removeObject:service.targetHost];
[self.delegate didGotBusinessServiceState:false host:service.targetHost hostIndex:index millionSeconds:0];
}
#pragma mark - Ping #pragma mark - Ping
- (void)_readHostAndPing - (void)_readHostAndPing
{ {
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
} }
_pingService.targetHost = _pingingHostList.firstObject; _pingService.targetHost = _pingingHostList.firstObject;
_pingService.pingCount = 1; _pingService.pingCount = 1;
_pingService.timeoutSeconds = 2; _pingService.timeoutSeconds = 1;
[_pingService starts]; [_pingService starts];
} }
- (void)_stopPingService - (void)_stopPingService
......
...@@ -21,16 +21,16 @@ ...@@ -21,16 +21,16 @@
[self.view addSubview:_detectView]; [self.view addSubview:_detectView];
[_detectView setBusinessHosts:@[ [_detectView setBusinessHosts:@[
@{ @{
@"name":@"· 赢家服务", @"name":@"· rmb",
@"host":@"ebank.com.cn" @"host":@"rmb-stg.pingan.com.cn"
}, },
@{ @{
@"name":@"· 老后管服务", @"name":@"· ebank-fat",
@"host":@"appmanager.orangebank.com.cn" @"host":@"test-ebank-fat.pingan.com.cn"
}, },
@{ @{
@"name":@"· 新后管服务", @"name":@"· myUat",
@"host":@"pc.orangebank.com.cn" @"host":@"my-uat1.orangebank.com.cn"
} }
]]; ]];
// Do any additional setup after loading the view, typically from a nib. // Do any additional setup after loading the view, typically from a nib.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment