in http/get_simple/csharp/client/ArrowHttpClient.cs [29:62]
public static async Task Main(string[] args)
{
string serverUri = "http://localhost:8008/";
DateTime startTime = DateTime.UtcNow;
HttpClient httpClient = new HttpClient
{
BaseAddress = new Uri(serverUri),
};
using (var stream = await httpClient.GetStreamAsync(serverUri))
using (var reader = new ArrowStreamReader(stream))
{
Console.WriteLine("Connected");
List<RecordBatch> batches = new List<RecordBatch>();
int numRows = 0;
RecordBatch batch;
while ((batch = await reader.ReadNextRecordBatchAsync()) != null)
{
numRows += batch.Length;
batches.Add(batch);
}
Schema schema = reader.Schema;
DateTime endTime = DateTime.UtcNow;
Console.WriteLine($"{numRows} records received");
Console.WriteLine($"{batches.Count} record batches received");
Console.WriteLine($"{(endTime - startTime).TotalSeconds} seconds elapsed");
}
}