102cc483dSShuo Chen#include "timer.h" 202cc483dSShuo Chen 38d51ab70SShuo Chen#include "TlsConfig.h" 48d51ab70SShuo Chen#include "TlsStream.h" 58d51ab70SShuo Chen 68d51ab70SShuo Chenint main(int argc, char* argv[]) 78d51ab70SShuo Chen{ 88d51ab70SShuo Chen TlsConfig config; 98d51ab70SShuo Chen config.setCaFile("ca.pem"); 1002cc483dSShuo Chen const char* hostport = "localhost:4433"; 1102cc483dSShuo Chen if (argc > 1) 1202cc483dSShuo Chen hostport = argv[1]; 1302cc483dSShuo Chen TlsStreamPtr stream = TlsStream::connect(&config, hostport, "Test Server Cert"); 148d51ab70SShuo Chen if (stream) 158d51ab70SShuo Chen { 168d51ab70SShuo Chen LOG_INFO << "OK"; 1702cc483dSShuo Chen char buf[16384] = { 0 }; 1802cc483dSShuo Chen int64_t total = 0; 1902cc483dSShuo Chen Timer t; 2002cc483dSShuo Chen t.start(); 2102cc483dSShuo Chen while (total < 1e10) 2202cc483dSShuo Chen { 2302cc483dSShuo Chen int nw = stream->sendSome(buf, sizeof buf); 2402cc483dSShuo Chen total += nw; 2502cc483dSShuo Chen } 2602cc483dSShuo Chen t.stop(); 2702cc483dSShuo Chen LOG_INFO << t.seconds(); 2802cc483dSShuo Chen // FIXME: getrusage() 298d51ab70SShuo Chen } 308d51ab70SShuo Chen} 31