code: func NewAgentIPC(agent *Agent, authKey string, listener net.Listener,
  	logOutput io.Writer, logWriter *logWriter) *AgentIPC {
  	if logOutput == nil {
  		logOutput = os.Stderr
  	}
  	ipc := &AgentIPC{
  		agent:     agent,
  		authKey:   authKey,
  		clients:   make(map[string]*IPCClient),
  		listener:  listener,
  		logger:    log.New(logOutput, "", log.LstdFlags),
  		logWriter: logWriter,
  		stopCh:    make(chan struct{}),
  	}
  	go ipc.listen()
  	return ipc
  }
docs: // NewAgentIPC is used to create a new Agent IPC handler