code: func (s *Server) Close() error {
  	s.Lock()
  	defer s.Unlock()
  
  	// If no listener is set, the server is in tunnel mode which means
  	// closeFunc has to be manually called.
  	if s.listener == nil {
  		s.closeFunc()
  		return nil
  	}
  
  	// listener already closed, nothing to do
  	if s.listenerClosed {
  		return nil
  	}
  
  	s.listenerClosed = true
  	if s.listener != nil {
  		err := s.listener.Close()
  		return err
  	}
  	return nil
  }
docs: // Close closes listening socket and stops accepting connections