code: func (s *Server) Close() {
  	s.rwlock.Lock()
  	defer s.rwlock.Unlock()
  
  	if s.listener != nil {
  		err := s.listener.Close()
  		terror.Log(errors.Trace(err))
  		s.listener = nil
  	}
  	if s.socket != nil {
  		err := s.socket.Close()
  		terror.Log(errors.Trace(err))
  		s.socket = nil
  	}
  	if s.statusServer != nil {
  		err := s.statusServer.Close()
  		terror.Log(errors.Trace(err))
  		s.statusServer = nil
  	}
  	metrics.ServerEventCounter.WithLabelValues(metrics.EventClose).Inc()
  }
docs: // Close closes the server.