code: func (s *session) closeLocal(e error) {
  	s.closeOnce.Do(func() {
  		if e == nil {
  			s.logger.Infof("Closing session.")
  		} else {
  			s.logger.Errorf("Closing session with error: %s", e)
  		}
  		s.sessionRunner.Retire(s.srcConnID)
  		s.closeChan <- closeError{err: e, sendClose: true, remote: false}
  	})
  }
docs: // closeLocal closes the session and send a CONNECTION_CLOSE containing the error