proxygen
folly::SSLServerAcceptCallback Class Reference

#include <AsyncSSLSocketTest.h>

Inheritance diagram for folly::SSLServerAcceptCallback:
folly::SSLServerAcceptCallbackBase folly::AsyncServerSocket::AcceptCallback folly::SSLServerAcceptCallbackDelay folly::SSLServerAsyncCacheAcceptCallback

Public Member Functions

 SSLServerAcceptCallback (HandshakeCallback *hcb, uint32_t timeout=0)
 
 ~SSLServerAcceptCallback () override
 
void connAccepted (const std::shared_ptr< folly::AsyncSSLSocket > &s) noexceptoverride
 
- Public Member Functions inherited from folly::SSLServerAcceptCallbackBase
 SSLServerAcceptCallbackBase (HandshakeCallback *hcb)
 
 ~SSLServerAcceptCallbackBase () override
 
void acceptError (const std::exception &ex) noexceptoverride
 
void connectionAccepted (int fd, const SocketAddress &) noexceptoverride
 
void detach ()
 
- Public Member Functions inherited from folly::AsyncServerSocket::AcceptCallback
virtual ~AcceptCallback ()=default
 
virtual void acceptStarted () noexcept
 
virtual void acceptStopped () noexcept
 

Public Attributes

uint32_t timeout_
 
- Public Attributes inherited from folly::SSLServerAcceptCallbackBase
StateEnum state
 
HandshakeCallbackhcb_
 
std::shared_ptr< SSLContextctx_
 
std::shared_ptr< AsyncSSLSocketsocket_
 
EventBasebase_
 

Detailed Description

Definition at line 547 of file AsyncSSLSocketTest.h.

Constructor & Destructor Documentation

folly::SSLServerAcceptCallback::SSLServerAcceptCallback ( HandshakeCallback hcb,
uint32_t  timeout = 0 
)
inlineexplicit

Definition at line 551 of file AsyncSSLSocketTest.h.

References folly::detail::timeout.

552  : SSLServerAcceptCallbackBase(hcb), timeout_(timeout) {}
SSLServerAcceptCallbackBase(HandshakeCallback *hcb)
Definition: TestSSLServer.h:51
folly::SSLServerAcceptCallback::~SSLServerAcceptCallback ( )
inlineoverride

Definition at line 554 of file AsyncSSLSocketTest.h.

References EXPECT_EQ, folly::STATE_FAILED, and folly::STATE_SUCCEEDED.

554  {
555  if (timeout_ > 0) {
556  // if we set a timeout, we expect failure
559  }
560  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922

Member Function Documentation

void folly::SSLServerAcceptCallback::connAccepted ( const std::shared_ptr< folly::AsyncSSLSocket > &  s)
inlineoverridevirtualnoexcept

Implements folly::SSLServerAcceptCallbackBase.

Reimplemented in folly::SSLServerAsyncCacheAcceptCallback, and folly::SSLServerAcceptCallbackDelay.

Definition at line 562 of file AsyncSSLSocketTest.h.

References EXPECT_EQ, s, folly::AsyncSSLSocket::sslAccept(), folly::AsyncSSLSocket::STATE_ACCEPTING, and folly::STATE_SUCCEEDED.

Referenced by folly::SSLServerAcceptCallbackDelay::connAccepted().

563  {
564  auto sock = std::static_pointer_cast<AsyncSSLSocket>(s);
565  std::cerr << "SSLServerAcceptCallback::connAccepted" << std::endl;
566 
567  hcb_->setSocket(sock);
568  sock->sslAccept(hcb_, std::chrono::milliseconds(timeout_));
569  EXPECT_EQ(sock->getSSLState(), AsyncSSLSocket::STATE_ACCEPTING);
570 
572  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
void setSocket(const std::shared_ptr< AsyncSSLSocket > &socket)
static set< string > s
state
Definition: http_parser.c:272

Member Data Documentation

uint32_t folly::SSLServerAcceptCallback::timeout_

Definition at line 549 of file AsyncSSLSocketTest.h.


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