code: func (a *Astilectron) acceptTCP(chanAccepted chan bool) {
  	for i := 0; i <= 1; i++ {
  		// Accept
  		var conn net.Conn
  		var err error
  		if conn, err = a.listener.Accept(); err != nil {
  			astilog.Errorf("%s while TCP accepting", err)
  			a.dispatcher.dispatch(Event{Name: EventNameAppErrorAccept, TargetID: targetIDApp})
  			a.dispatcher.dispatch(Event{Name: EventNameAppCmdStop, TargetID: targetIDApp})
  			return
  		}
  
  		// We only accept the first connection which should be Astilectron, close the next one and stop
  		// the app
  		if i > 0 {
  			astilog.Errorf("Too many TCP connections")
  			a.dispatcher.dispatch(Event{Name: EventNameAppTooManyAccept, TargetID: targetIDApp})
  			a.dispatcher.dispatch(Event{Name: EventNameAppCmdStop, TargetID: targetIDApp})
  			conn.Close()
  			return
  		}
  
  		// Let the timer know a connection has been accepted
  		chanAccepted <- true
  
  		// Create reader and writer
  		a.writer = newWriter(conn)
  		ctx, _ := a.canceller.NewContext()
  		a.reader = newReader(ctx, a.dispatcher, conn)
  		go a.reader.read()
  	}
  }
docs: // watchAcceptTCP accepts TCP connections