This commit is contained in:
esrrhs 2018-12-19 15:02:37 +08:00
parent 11b15f071e
commit a8ea8a358a

View File

@ -60,7 +60,9 @@ func (p *Server) Run() {
func (p *Server) processPacket(packet *Packet) { func (p *Server) processPacket(packet *Packet) {
if packet.msgType == PING { if packet.msgType == PING {
fmt.Printf("pong from %s\n", packet.src.String()) t := time.Time{}
t.UnmarshalBinary(packet.data)
fmt.Printf("pong from %s %s\n", packet.src.String(), t.String())
sendICMP(*p.conn, packet.src, "", "", (uint32)(DATA), packet.data, packet.rproto, 0) sendICMP(*p.conn, packet.src, "", "", (uint32)(DATA), packet.data, packet.rproto, 0)
return return
} }