130 std::shared_ptr<SSLSessionPersistentCache> cache;
131 if (!FLAGS_cache_file.empty()) {
132 cache = std::make_shared<SSLSessionPersistentCache>(
133 FLAGS_cache_file, 100, std::chrono::seconds(60));
136 EchoClientBootstrap client;
137 client.group(std::make_shared<IOThreadPoolExecutor>(1));
138 client.pipelineFactory(std::make_shared<EchoPipelineFactory>());
141 auto ctx = createSSLContext();
145 ctx->getSSLCtx(), cache.get());
148 VLOG(0) <<
"Reusing session";
149 client.sslSession(session.release());
152 client.sslContext(ctx);
156 VLOG(0) <<
"Connecting";
157 auto pipeline = client.connect(
addr).get();
158 VLOG(0) <<
"Connected";
167 VLOG(0) <<
"Sending " << line;
168 pipeline->write(line +
"\r\n").get();
174 }
catch (
const std::exception& e) {
const std::string SESSION_KEY
fbstring exceptionStr(const std::exception &e)
void BENCHFUN() getline(size_t iters, size_t arg)
static void attachCallbacksToContext(SSL_CTX *ctx, SSLSessionCallbacks *callbacks)
ThreadPoolListHook * addr