code: func (s *StanServer) processCloseRequest(m *nats.Msg) {
  	req := &pb.CloseRequest{}
  	err := req.Unmarshal(m.Data)
  	if err != nil {
  		s.log.Errorf("Received invalid close request, subject=%s", m.Subject)
  		s.sendCloseResponse(m.Reply, ErrInvalidCloseReq)
  		return
  	}
  
  	s.barrier(func() {
  		var err error
  		// If clustered, thread operations through Raft.
  		if s.isClustered {
  			err = s.replicateConnClose(req)
  		} else {
  			err = s.closeClient(req.ClientID)
  		}
  		// If there was an error, it has been already logged.
  
  		// Send response, if err is nil, will be a success response.
  		s.sendCloseResponse(m.Reply, err)
  	})
  }
docs: // processCloseRequest will process connection close requests from clients.