MCPcopy Create free account
hub / github.com/Cyinx/einx / Ping

Method Ping

network/tcp_conn.go:161–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159}
160
161func (this *TcpConn) Ping() bool {
162 if this.IsClosed() == true {
163 return false
164 }
165 check_duration := PINGTIME / 1000
166 check_time := GetNowTick() - this.GetLastPingTime()
167 if check_time <= (check_duration * 2) {
168 if this.conn_type == Linker_TCP_OutGoing {
169 this.DoPing()
170 }
171 return true
172 }
173 this.Close()
174 return false
175}
176
177func (this *TcpConn) GetLastPingTime() int64 {
178 return atomic.LoadInt64(&this.last_ping_tick)

Callers

nothing calls this directly

Calls 5

IsClosedMethod · 0.95
GetLastPingTimeMethod · 0.95
DoPingMethod · 0.95
CloseMethod · 0.95
GetNowTickFunction · 0.85

Tested by

no test coverage detected