proxygen
folly::SSLAcceptCloseRunner Class Reference

#include <AsyncSSLSocketTest.h>

Inheritance diagram for folly::SSLAcceptCloseRunner:
folly::SSLAcceptEvbRunner folly::SSLAcceptRunner

Public Member Functions

 SSLAcceptCloseRunner (EventBase *evb, folly::AsyncSSLSocket *sock)
 
 ~SSLAcceptCloseRunner () override=default
 
void run (Function< int()> acceptFunc, Function< void(int)> finallyFunc) const override
 
- Public Member Functions inherited from folly::SSLAcceptEvbRunner
 SSLAcceptEvbRunner (EventBase *evb)
 
 ~SSLAcceptEvbRunner () override=default
 
- Public Member Functions inherited from folly::SSLAcceptRunner
virtual ~SSLAcceptRunner ()=default
 

Private Attributes

folly::AsyncSSLSocketsocket_
 

Additional Inherited Members

- Protected Attributes inherited from folly::SSLAcceptEvbRunner
EventBaseevb_
 

Detailed Description

Definition at line 1489 of file AsyncSSLSocketTest.h.

Constructor & Destructor Documentation

folly::SSLAcceptCloseRunner::SSLAcceptCloseRunner ( EventBase evb,
folly::AsyncSSLSocket sock 
)
inlineexplicit

Definition at line 1491 of file AsyncSSLSocketTest.h.

1492  : SSLAcceptEvbRunner(evb), socket_(sock) {}
folly::AsyncSSLSocket * socket_
folly::SSLAcceptCloseRunner::~SSLAcceptCloseRunner ( )
overridedefault

Member Function Documentation

void folly::SSLAcceptCloseRunner::run ( Function< int()>  acceptFunc,
Function< void(int)>  finallyFunc 
) const
inlineoverridevirtual

This is expected to run the first function and provide its return value to the second function. This can be used to run the SSL_accept in different contexts.

Reimplemented from folly::SSLAcceptEvbRunner.

Definition at line 1495 of file AsyncSSLSocketTest.h.

References evb_, folly::gen::move, and folly::SendMsgParamsCallbackBase::socket_.

1496  {
1497  evb_->runInLoop([acceptFunc = std::move(acceptFunc),
1498  finallyFunc = std::move(finallyFunc),
1499  sock = socket_]() mutable {
1500  auto ret = acceptFunc();
1501  sock->closeNow();
1502  finallyFunc(ret);
1503  });
1504  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
void runInLoop(LoopCallback *callback, bool thisIteration=false)
Definition: EventBase.cpp:520
folly::AsyncSSLSocket * socket_

Member Data Documentation

folly::AsyncSSLSocket* folly::SSLAcceptCloseRunner::socket_
private

Definition at line 1507 of file AsyncSSLSocketTest.h.


The documentation for this class was generated from the following file: