ping
This commit is contained in:
parent
aefdb4d724
commit
5f0c3e9fc6
|
@ -38,6 +38,7 @@ func processPrepacket(service *omd.Service, pingOption ounp.Option, matchCtx *os
|
|||
|
||||
LOOP:
|
||||
for indexR := 0; indexR < pingOption.GetRetry(); indexR++ {
|
||||
startTime := time.Now()
|
||||
matchCtx.InitAttribute()
|
||||
conn, err := getConnection(service, pingOption)
|
||||
if nil != err {
|
||||
|
@ -128,8 +129,9 @@ LOOP:
|
|||
conn.Close()
|
||||
|
||||
if isMatched {
|
||||
elapsed := time.Since(startTime)
|
||||
pingResult.Responses[indexR] = &ounp.PingResponse{
|
||||
Time: 0,
|
||||
Time: float32(elapsed),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -147,6 +149,7 @@ func processPostpacket(service *omd.Service, pingOption ounp.Option, matchCtx *o
|
|||
|
||||
LOOP:
|
||||
for indexR := 0; indexR < pingOption.GetRetry(); indexR++ {
|
||||
startTime := time.Now()
|
||||
matchCtx.InitAttribute()
|
||||
packetCount := _matcher.PacketCount(matchCtx)
|
||||
|
||||
|
@ -215,8 +218,9 @@ LOOP:
|
|||
conn.Close()
|
||||
|
||||
if isMatched {
|
||||
elapsed := time.Since(startTime)
|
||||
pingResult.Responses[indexR] = &ounp.PingResponse{
|
||||
Time: 0,
|
||||
Time: float32(elapsed),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user