This commit is contained in:
esrrhs 2018-12-22 18:36:29 +08:00
parent 0481f15f07
commit e1cdec8c00

View File

@ -241,13 +241,11 @@ func (p *Client) checkTimeoutConn() {
} }
func (p *Client) ping() { func (p *Client) ping() {
if p.sendPacket == 0 {
now := time.Now() now := time.Now()
b, _ := now.MarshalBinary() b, _ := now.MarshalBinary()
sendICMP(p.id, p.sequence, *p.conn, p.ipaddrServer, p.targetAddr, "", (uint32)(PING), b, p.sproto, p.rproto) sendICMP(p.id, p.sequence, *p.conn, p.ipaddrServer, p.targetAddr, "", (uint32)(PING), b, p.sproto, p.rproto)
fmt.Printf("ping %s %s %d %d %d %d\n", p.addrServer, now.String(), p.sproto, p.rproto, p.id, p.sequence) fmt.Printf("ping %s %s %d %d %d %d\n", p.addrServer, now.String(), p.sproto, p.rproto, p.id, p.sequence)
p.sequence++ p.sequence++
}
} }
func (p *Client) showNet() { func (p *Client) showNet() {