code: func (as *AgentServer) serveTcp(listener net.Listener) {
  
  	for {
  		// Listen for an incoming connection.
  		conn, err := listener.Accept()
  		if err != nil {
  			fmt.Println("Error accepting: ", err.Error())
  			continue
  		}
  		// Handle connections in a new goroutine.
  		go func() {
  			defer conn.Close()
  			if err = conn.SetDeadline(time.Time{}); err != nil {
  				fmt.Printf("Failed to set timeout: %v\n", err)
  			}
  			if c, ok := conn.(*net.TCPConn); ok {
  				c.SetKeepAlive(true)
  			}
  			as.handleRequest(conn)
  		}()
  	}
  }
docs: // Run starts the heartbeating to master and starts accepting requests.