proxygen
wangle::AsyncSocketHandler::WriteCallback Class Reference
Inheritance diagram for wangle::AsyncSocketHandler::WriteCallback:
folly::AsyncWriter::WriteCallback

Private Member Functions

void writeSuccess () noexceptoverride
 
void writeErr (size_t, const folly::AsyncSocketException &ex) noexceptoverride
 
- Private Member Functions inherited from folly::AsyncWriter::WriteCallback
virtual ~WriteCallback ()=default
 

Private Attributes

folly::Promise< folly::Unitpromise_
 

Friends

class AsyncSocketHandler
 

Detailed Description

Definition at line 191 of file AsyncSocketHandler.h.

Member Function Documentation

void wangle::AsyncSocketHandler::WriteCallback::writeErr ( size_t  bytesWritten,
const folly::AsyncSocketException ex 
)
inlineoverrideprivatevirtualnoexcept

writeError() will be invoked if an error occurs writing the data.

Parameters
bytesWrittenThe number of bytes that were successfull
exAn exception describing the error that occurred.

Implements folly::AsyncWriter::WriteCallback.

Definition at line 197 of file AsyncSocketHandler.h.

References promise_, and folly::Promise< T >::setException().

199  {
201  delete this;
202  }
folly::Promise< folly::Unit > promise_
void setException(exception_wrapper ew)
Definition: Promise-inl.h:111
void wangle::AsyncSocketHandler::WriteCallback::writeSuccess ( )
inlineoverrideprivatevirtualnoexcept

writeSuccess() will be invoked when all of the data has been successfully written.

Note that this mainly signals that the buffer containing the data to write is no longer needed and may be freed or re-used. It does not guarantee that the data has been fully transmitted to the remote endpoint. For example, on socket-based transports, writeSuccess() only indicates that the data has been given to the kernel for eventual transmission.

Implements folly::AsyncWriter::WriteCallback.

Definition at line 192 of file AsyncSocketHandler.h.

References promise_, and folly::Promise< T >::setValue().

192  {
193  promise_.setValue();
194  delete this;
195  }
folly::Promise< folly::Unit > promise_
std::enable_if< std::is_same< Unit, B >::value, void >::type setValue()
Definition: Promise.h:326

Friends And Related Function Documentation

friend class AsyncSocketHandler
friend

Definition at line 205 of file AsyncSocketHandler.h.

Member Data Documentation

folly::Promise<folly::Unit> wangle::AsyncSocketHandler::WriteCallback::promise_
private

Definition at line 206 of file AsyncSocketHandler.h.

Referenced by writeErr(), and writeSuccess().


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