code: func (s *StanServer) processClientPings(m *nats.Msg) {
  	if len(m.Data) == 0 {
  		return
  	}
  	ping := &pb.Ping{}
  	if err := ping.Unmarshal(m.Data); err != nil {
  		return
  	}
  	var reply []byte
  	client := s.clients.lookupByConnID(ping.ConnID)
  	if client != nil {
  		// If the client has failed heartbeats and since the
  		// server just received a PING from the client, reset
  		// the server-to-client HB timer so that a PING is
  		// sent soon and the client's subscriptions failedHB
  		// is cleared.
  		client.RLock()
  		hasFailedHBs := client.fhb > 0
  		client.RUnlock()
  		if hasFailedHBs {
  			client.Lock()
  			client.hbt.Reset(time.Millisecond)
  			client.Unlock()
  		}
  		if s.pingResponseOKBytes == nil {
  			s.pingResponseOKBytes, _ = (&pb.PingResponse{}).Marshal()
  		}
  		reply = s.pingResponseOKBytes
  	} else {
  		if s.pingResponseInvalidClientBytes == nil {
  			pingError := &pb.PingResponse{
  				Error: "client has been replaced or is no longer registered",
  			}
  			s.pingResponseInvalidClientBytes, _ = pingError.Marshal()
  		}
  		reply = s.pingResponseInvalidClientBytes
  	}
  	s.ncs.Publish(m.Reply, reply)
  }
docs: // processClientPings receives a PING from a client. The payload is the client's UID.
  // If the client is present, a response with nil payload is sent back to indicate
  // success, otherwise the payload contains an error message.