1#include "timer.h"
2
3#include "TlsConfig.h"
4#include "TlsStream.h"
5
6int main(int argc, char* argv[])
7{
8  TlsConfig config;
9  config.setCaFile("ca.pem");
10  const char* hostport = "localhost:4433";
11  if (argc > 1)
12    hostport = argv[1];
13  TlsStreamPtr stream = TlsStream::connect(&config, hostport, "Test Server Cert");
14  if (stream)
15  {
16    LOG_INFO << "OK";
17    char buf[16384] = { 0 };
18    int64_t total = 0;
19    Timer t;
20    t.start();
21    while (total < 1e10)
22    {
23      int nw = stream->sendSome(buf, sizeof buf);
24      total += nw;
25    }
26    t.stop();
27    LOG_INFO << t.seconds();
28    // FIXME: getrusage()
29  }
30}
31