code: func (i *AgentIPC) handleClient(client *IPCClient) {
  	defer i.deregisterClient(client)
  	var reqHeader requestHeader
  	for {
  		// Decode the header
  		if err := client.dec.Decode(&reqHeader); err != nil {
  			if !i.stop {
  				// The second part of this if is to block socket
  				// errors from Windows which appear to happen every
  				// time there is an EOF.
  				if err != io.EOF && !strings.Contains(strings.ToLower(err.Error()), "wsarecv") {
  					i.logger.Printf("[ERR] agent.ipc: failed to decode request header: %v", err)
  				}
  			}
  			return
  		}
  
  		// Evaluate the command
  		if err := i.handleRequest(client, &reqHeader); err != nil {
  			i.logger.Printf("[ERR] agent.ipc: Failed to evaluate request: %v", err)
  			return
  		}
  	}
  }
docs: // handleClient is a long running routine that handles a single client