()
| 159 | } |
| 160 | |
| 161 | func (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 | |
| 177 | func (this *TcpConn) GetLastPingTime() int64 { |
| 178 | return atomic.LoadInt64(&this.last_ping_tick) |
nothing calls this directly
no test coverage detected