code: func (s *Server) Close() error {
  	s.cancel()
  	s.reg.Close()
  	if s.heartbeat != nil {
  		if err := s.heartbeat.Close(); err != nil {
  			s.Warningf("Failed to close heartbeat: %v", err)
  		}
  		s.heartbeat = nil
  	}
  	return s.srv.Close()
  }
docs: // Close closes listening socket and stops accepting connections