proxygen
folly::ReadCallbackBase Class Reference

#include <AsyncSSLSocketTest.h>

Inheritance diagram for folly::ReadCallbackBase:
folly::AsyncReader::ReadCallback folly::NoopReadCallback folly::ReadCallback folly::ReadEOFCallback folly::ReadErrorCallback folly::AsyncSSLSocket::DefaultOpenSSLAsyncFinishCallback folly::EmptyReadCallback folly::ReadCallbackTerminator folly::WriteErrorCallback

Public Member Functions

 ReadCallbackBase (WriteCallbackBase *wcb)
 
 ~ReadCallbackBase () override
 
void setSocket (const std::shared_ptr< AsyncSSLSocket > &socket)
 
void setState (StateEnum s)
 
void readErr (const AsyncSocketException &ex) noexceptoverride
 
void readEOF () noexceptoverride
 
- Public Member Functions inherited from folly::AsyncReader::ReadCallback
virtual ~ReadCallback ()=default
 
virtual void getReadBuffer (void **bufReturn, size_t *lenReturn)=0
 
virtual void readDataAvailable (size_t len) noexcept=0
 
virtual bool isBufferMovable () noexcept
 
virtual size_t maxBufferSize () const
 
virtual void readBufferAvailable (std::unique_ptr< IOBuf >) noexcept
 

Public Attributes

std::shared_ptr< AsyncSSLSocketsocket_
 
WriteCallbackBasewcb_
 
StateEnum state
 

Detailed Description

Definition at line 277 of file AsyncSSLSocketTest.h.

Constructor & Destructor Documentation

folly::ReadCallbackBase::ReadCallbackBase ( WriteCallbackBase wcb)
inlineexplicit

Definition at line 279 of file AsyncSSLSocketTest.h.

folly::ReadCallbackBase::~ReadCallbackBase ( )
inlineoverride

Definition at line 282 of file AsyncSSLSocketTest.h.

References EXPECT_EQ, and folly::STATE_SUCCEEDED.

282  {
284  }
#define EXPECT_EQ(val1, val2)
Definition: gtest.h:1922
state
Definition: http_parser.c:272

Member Function Documentation

void folly::ReadCallbackBase::readEOF ( )
inlineoverridevirtualnoexcept

readEOF() will be invoked when the transport is closed.

The read callback will be automatically uninstalled immediately before readEOF() is invoked.

Implements folly::AsyncReader::ReadCallback.

Reimplemented in folly::EmptyReadCallback, and folly::ReadEOFCallback.

Definition at line 303 of file AsyncSSLSocketTest.h.

References folly::SendMsgParamsCallbackBase::socket_.

Referenced by folly::ReadEOFCallback::readEOF().

303  {
304  std::cerr << "readEOF" << std::endl;
305 
306  socket_->close();
307  }
std::shared_ptr< AsyncSSLSocket > socket_
void folly::ReadCallbackBase::readErr ( const AsyncSocketException ex)
inlineoverridevirtualnoexcept

readError() will be invoked if an error occurs reading from the transport.

The read callback will be automatically uninstalled immediately before readError() is invoked.

Parameters
exAn exception describing the error that occurred.

Implements folly::AsyncReader::ReadCallback.

Reimplemented in folly::EmptyReadCallback, folly::WriteErrorCallback, and folly::ReadErrorCallback.

Definition at line 297 of file AsyncSSLSocketTest.h.

References folly::SendMsgParamsCallbackBase::socket_, and folly::STATE_FAILED.

Referenced by folly::ReadErrorCallback::readErr().

297  {
298  std::cerr << "readError " << ex.what() << std::endl;
300  socket_->close();
301  }
std::shared_ptr< AsyncSSLSocket > socket_
state
Definition: http_parser.c:272
void folly::ReadCallbackBase::setSocket ( const std::shared_ptr< AsyncSSLSocket > &  socket)
inline

Definition at line 286 of file AsyncSSLSocketTest.h.

References folly::netops::socket(), and folly::SendMsgParamsCallbackBase::socket_.

Referenced by folly::TEST().

286  {
287  socket_ = socket;
288  }
NetworkSocket socket(int af, int type, int protocol)
Definition: NetOps.cpp:412
std::shared_ptr< AsyncSSLSocket > socket_
void folly::ReadCallbackBase::setState ( StateEnum  s)
inline

Definition at line 290 of file AsyncSSLSocketTest.h.

References s.

290  {
291  state = s;
292  if (wcb_) {
293  wcb_->state = s;
294  }
295  }
WriteCallbackBase * wcb_
static set< string > s
state
Definition: http_parser.c:272

Member Data Documentation

std::shared_ptr<AsyncSSLSocket> folly::ReadCallbackBase::socket_

Definition at line 309 of file AsyncSSLSocketTest.h.

StateEnum folly::ReadCallbackBase::state

Definition at line 311 of file AsyncSSLSocketTest.h.

Referenced by TEST(), folly::TEST(), and TEST_P().

WriteCallbackBase* folly::ReadCallbackBase::wcb_

Definition at line 310 of file AsyncSSLSocketTest.h.


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