proxygen
folly::ReadCallbackTerminator Class Reference
Inheritance diagram for folly::ReadCallbackTerminator:
folly::ReadCallback folly::ReadCallbackBase folly::AsyncReader::ReadCallback

Public Member Functions

 ReadCallbackTerminator (EventBase *base, WriteCallbackBase *wcb)
 
void readDataAvailable (size_t len) noexceptoverride
 
- Public Member Functions inherited from folly::ReadCallback
 ReadCallback (WriteCallbackBase *wcb)
 
 ~ReadCallback () override
 
void getReadBuffer (void **bufReturn, size_t *lenReturn) override
 
void readDataAvailable (size_t len) noexceptoverride
 
- Public Member Functions inherited from folly::ReadCallbackBase
 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 bool isBufferMovable () noexcept
 
virtual size_t maxBufferSize () const
 
virtual void readBufferAvailable (std::unique_ptr< IOBuf >) noexcept
 

Private Attributes

EventBasebase_
 

Additional Inherited Members

- Public Attributes inherited from folly::ReadCallback
std::vector< Bufferbuffers
 
Buffer currentBuffer
 
- Public Attributes inherited from folly::ReadCallbackBase
std::shared_ptr< AsyncSSLSocketsocket_
 
WriteCallbackBasewcb_
 
StateEnum state
 

Detailed Description

Definition at line 1847 of file AsyncSSLSocketTest.cpp.

Constructor & Destructor Documentation

folly::ReadCallbackTerminator::ReadCallbackTerminator ( EventBase base,
WriteCallbackBase wcb 
)
inline

Definition at line 1849 of file AsyncSSLSocketTest.cpp.

1850  : ReadCallback(wcb), base_(base) {}
ReadCallback(WriteCallbackBase *wcb)

Member Function Documentation

void folly::ReadCallbackTerminator::readDataAvailable ( size_t  len)
inlineoverridevirtualnoexcept

readDataAvailable() will be invoked when data has been successfully read into the buffer returned by the last call to getReadBuffer().

The read callback remains installed after readDataAvailable() returns. It must be explicitly uninstalled to stop receiving read events. getReadBuffer() will be called at least once before each call to readDataAvailable(). getReadBuffer() will also be called before any call to readEOF().

Parameters
lenThe number of bytes placed in the buffer.

Implements folly::AsyncReader::ReadCallback.

Definition at line 1853 of file AsyncSSLSocketTest.cpp.

References base_, socket_, and STATE_SUCCEEDED.

1853  {
1854  std::cerr << "readDataAvailable, len " << len << std::endl;
1855 
1856  currentBuffer.length = len;
1857 
1858  buffers.push_back(currentBuffer);
1859  currentBuffer.reset();
1861 
1862  socket_->setReadCB(nullptr);
1864  }
std::vector< Buffer > buffers
void terminateLoopSoon()
Definition: EventBase.cpp:493
std::shared_ptr< AsyncSSLSocket > socket_
state
Definition: http_parser.c:272

Member Data Documentation

EventBase* folly::ReadCallbackTerminator::base_
private

Definition at line 1867 of file AsyncSSLSocketTest.cpp.


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