proxygen
|
#include <AsyncPipe.h>
Public Types | |
typedef std::unique_ptr< AsyncPipeReader, folly::DelayedDestruction::Destructor > | UniquePtr |
Public Types inherited from folly::EventHandler | |
enum | EventFlags { NONE = 0, READ = EV_READ, WRITE = EV_WRITE, READ_WRITE = (READ | WRITE), PERSIST = EV_PERSIST } |
Static Public Member Functions | |
template<typename... Args> | |
static UniquePtr | newReader (Args &&...args) |
Private Member Functions | |
~AsyncPipeReader () override | |
void | handlerReady (uint16_t events) noexceptoverride |
void | failRead (const AsyncSocketException &ex) |
void | close () |
Private Attributes | |
int | fd_ |
AsyncReader::ReadCallback * | readCallback_ {nullptr} |
std::function< void(int)> | closeCb_ |
Additional Inherited Members | |
Protected Member Functions inherited from folly::AsyncReader | |
virtual | ~AsyncReader ()=default |
Protected Member Functions inherited from folly::DelayedDestruction | |
~DelayedDestruction () override=default | |
DelayedDestruction () | |
Protected Member Functions inherited from folly::DelayedDestructionBase | |
DelayedDestructionBase () | |
uint32_t | getDestructorGuardCount () const |
Read from a pipe in an async manner.
Definition at line 34 of file AsyncPipe.h.
typedef std:: unique_ptr<AsyncPipeReader, folly::DelayedDestruction::Destructor> folly::AsyncPipeReader::UniquePtr |
Definition at line 40 of file AsyncPipe.h.
|
inline |
Definition at line 47 of file AsyncPipe.h.
Referenced by newReader().
|
overrideprivate |
|
private |
Definition at line 43 of file AsyncPipe.cpp.
References folly::EventHandler::changeHandlerFD(), closeCb_, fd_, and folly::EventHandler::unregisterHandler().
Referenced by folly::AsyncPipeWriter::closeNow(), failRead(), setCloseCallback(), and ~AsyncPipeReader().
|
private |
Definition at line 32 of file AsyncPipe.cpp.
References close(), fd_, readCallback_, and folly::AsyncReader::ReadCallback::readErr().
Referenced by handlerReady(), and setCloseCallback().
|
inlineoverridevirtual |
Get the read callback
Implements folly::AsyncReader.
Definition at line 69 of file AsyncPipe.h.
References readCallback_.
|
overrideprivatevirtualnoexcept |
handlerReady() is invoked when the handler is ready.
events | A bitset indicating the events that are ready. |
Implements folly::EventHandler.
Definition at line 57 of file AsyncPipe.cpp.
References folly::IOBuf::append(), folly::AsyncSocketException::BAD_ARGS, folly::IOBuf::capacity(), folly::IOBuf::create(), failRead(), fd_, folly::AsyncReader::ReadCallback::getReadBuffer(), folly::AsyncSocketException::INVALID_STATE, folly::AsyncReader::ReadCallback::isBufferMovable(), folly::AsyncReader::ReadCallback::maxBufferSize(), folly::gen::move, folly::EventHandler::READ, folly::AsyncReader::ReadCallback::readBufferAvailable(), readCallback_, folly::AsyncReader::ReadCallback::readDataAvailable(), folly::AsyncReader::ReadCallback::readEOF(), folly::readNoInt(), folly::EventHandler::unregisterHandler(), and folly::IOBuf::writableBuffer().
Referenced by setCloseCallback(), and folly::AsyncPipeWriter::writev().
|
inlinestatic |
Definition at line 43 of file AsyncPipe.h.
References AsyncPipeReader().
Referenced by folly::AsyncSSLSocket::willBlock().
|
inline |
Set a special hook to close the socket (otherwise, will call close())
Definition at line 76 of file AsyncPipe.h.
References close(), closeCb_, failRead(), handlerReady(), folly::pushmi::__adl::noexcept(), uint16_t, and ~AsyncPipeReader().
|
inlineoverridevirtual |
Set the read callback and automatically install/uninstall the handler for events.
Implements folly::AsyncReader.
Definition at line 54 of file AsyncPipe.h.
References folly::EventHandler::isHandlerRegistered(), folly::EventHandler::PERSIST, folly::EventHandler::READ, readCallback_, folly::EventHandler::registerHandler(), and folly::EventHandler::unregisterHandler().
|
private |
Definition at line 89 of file AsyncPipe.h.
Referenced by close(), folly::AsyncPipeWriter::closeNow(), setCloseCallback(), and folly::AsyncPipeWriter::setCloseCallback().
|
private |
Definition at line 87 of file AsyncPipe.h.
Referenced by close(), folly::AsyncPipeWriter::closed(), folly::AsyncPipeWriter::closeNow(), failRead(), handlerReady(), and folly::AsyncPipeWriter::handleWrite().
|
private |
Definition at line 88 of file AsyncPipe.h.
Referenced by failRead(), getReadCallback(), handlerReady(), and setReadCB().