code: func (cm *ConnManager) listenHandler(listener net.Listener) {
  	log.Infof("Server listening on %s", listener.Addr())
  	for atomic.LoadInt32(&cm.stop) == 0 {
  		conn, err := listener.Accept()
  		if err != nil {
  			// Only log the error if not forcibly shutting down.
  			if atomic.LoadInt32(&cm.stop) == 0 {
  				log.Errorf("Can't accept connection: %v", err)
  			}
  			continue
  		}
  		go cm.cfg.OnAccept(conn)
  	}
  
  	cm.wg.Done()
  	log.Tracef("Listener handler done for %s", listener.Addr())
  }
docs: // listenHandler accepts incoming connections on a given listener.  It must be
  // run as a goroutine.