Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CRMNetDetect
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
oc
CRMNetDetect
Commits
f530f5e7
Commit
f530f5e7
authored
Oct 18, 2024
by
GuoJianPeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
b8790e38
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
20 deletions
+20
-20
CRMNetDetect/Classes/CRMNetDetectService.m
+14
-14
Example/CRMNetDetect/ASViewController.m
+6
-6
No files found.
CRMNetDetect/Classes/CRMNetDetectService.m
View file @
f530f5e7
...
@@ -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
...
...
Example/CRMNetDetect/ASViewController.m
View file @
f530f5e7
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment