proxygen
folly::test::MockWriteCallback Class Reference

#include <MockAsyncTransport.h>

Inheritance diagram for folly::test::MockWriteCallback:
folly::AsyncWriter::WriteCallback

Public Member Functions

 MOCK_METHOD0 (writeSuccess_, void())
 
void writeSuccess () noexceptoverride
 
 MOCK_METHOD2 (writeErr_, void(size_t, const AsyncSocketException &))
 
void writeErr (size_t size, const AsyncSocketException &ex) noexceptoverride
 
- Public Member Functions inherited from folly::AsyncWriter::WriteCallback
virtual ~WriteCallback ()=default
 

Detailed Description

Definition at line 113 of file MockAsyncTransport.h.

Member Function Documentation

folly::test::MockWriteCallback::MOCK_METHOD0 ( writeSuccess_  ,
void()   
)
folly::test::MockWriteCallback::MOCK_METHOD2 ( writeErr_  ,
void(size_t, const AsyncSocketException &)   
)
void folly::test::MockWriteCallback::writeErr ( size_t  bytesWritten,
const AsyncSocketException ex 
)
inlineoverridevirtualnoexcept

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 121 of file MockAsyncTransport.h.

References folly::size().

121  {
122  writeErr_(size, ex);
123  }
constexpr auto size(C const &c) -> decltype(c.size())
Definition: Access.h:45
void folly::test::MockWriteCallback::writeSuccess ( )
inlineoverridevirtualnoexcept

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 116 of file MockAsyncTransport.h.

References MOCK_METHOD2.

116  {
117  writeSuccess_();
118  }

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