code: func (s *Server) killServe() error {
  	s.l.Lock()
  	defer s.l.Unlock()
  
  	if s.ctx == nil {
  		return errors.New("not initialized")
  	}
  
  	// Stop accepting requests, unblocks serve(). Do it only once.
  	if s.listener != nil {
  		logging.Debugf(s.ctx, "Stopping the local server %q...", s.name)
  		if err := s.listener.Close(); err != nil {
  			logging.WithError(err).Errorf(s.ctx, "Failed to close the listening socket of %q", s.name)
  		}
  		s.listener = nil
  	}
  	s.cancel() // notify all running handlers to stop
  
  	return nil
  }
docs: // killServe notifies the serving goroutine to stop (if it is running).