in http/get_simple/cpp/client/client.cpp [36:74]
int main(void)
{
std::string url = "http://localhost:8008";
CURL *curl_handle;
CURLcode res;
// We use arrow::ipc::CollectListner() here for simplicity,
// but another option is to process decoded record batches
// as a stream by overriding arrow::ipc::Listener().
auto collect_listener = std::make_shared<arrow::ipc::CollectListener>();
arrow::ipc::StreamDecoder decoder(collect_listener);
curl_global_init(CURL_GLOBAL_ALL);
curl_handle = curl_easy_init();
curl_easy_setopt(curl_handle, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteFunction);
curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, &decoder);
auto start_time = std::chrono::steady_clock::now();
res = curl_easy_perform(curl_handle);
printf("%lld record batches received\n", collect_listener->num_record_batches());
auto end_time = std::chrono::steady_clock::now();
auto time_duration = std::chrono::duration_cast<std::chrono::duration<double>>(end_time - start_time);
printf("%.2f seconds elapsed\n", time_duration.count());
curl_easy_cleanup(curl_handle);
curl_global_cleanup();
std::vector<std::shared_ptr<arrow::RecordBatch>> record_batches;
record_batches = collect_listener->record_batches();
return 0;
}