proxygen
folly::AsyncSocket::WriteRequest Class Referenceabstract

#include <AsyncSocket.h>

Inheritance diagram for folly::AsyncSocket::WriteRequest:
folly::AsyncSocket::BytesWriteRequest

Public Member Functions

 WriteRequest (AsyncSocket *socket, WriteCallback *callback)
 
virtual void start ()
 
virtual void destroy ()=0
 
virtual WriteResult performWrite ()=0
 
virtual void consume ()=0
 
virtual bool isComplete ()=0
 
WriteRequestgetNext () const
 
WriteCallbackgetCallback () const
 
uint32_t getTotalBytesWritten () const
 
void append (WriteRequest *next)
 
void fail (const char *fn, const AsyncSocketException &ex)
 
void bytesWritten (size_t count)
 

Protected Member Functions

virtual ~WriteRequest ()
 

Protected Attributes

AsyncSocketsocket_
 parent socket More...
 
WriteRequestnext_ {nullptr}
 pointer to next WriteRequest More...
 
WriteCallbackcallback_
 completion callback More...
 
uint32_t totalBytesWritten_ {0}
 total bytes written More...
 

Detailed Description

A WriteRequest object tracks information about a pending write operation.

Definition at line 888 of file AsyncSocket.h.

Constructor & Destructor Documentation

folly::AsyncSocket::WriteRequest::WriteRequest ( AsyncSocket socket,
WriteCallback callback 
)
inline

Definition at line 890 of file AsyncSocket.h.

891  : socket_(socket), callback_(callback) {}
AsyncSocket * socket_
parent socket
Definition: AsyncSocket.h:933
NetworkSocket socket(int af, int type, int protocol)
Definition: NetOps.cpp:412
WriteCallback * callback_
completion callback
Definition: AsyncSocket.h:935
virtual folly::AsyncSocket::WriteRequest::~WriteRequest ( )
inlineprotectedvirtual

Definition at line 931 of file AsyncSocket.h.

931 {}

Member Function Documentation

void folly::AsyncSocket::WriteRequest::append ( WriteRequest next)
inline

Definition at line 915 of file AsyncSocket.h.

References cpp.ast::next().

Referenced by folly::AsyncSocket::writeImpl(), and folly::AsyncSocket::writeRequest().

915  {
916  assert(next_ == nullptr);
917  next_ = next;
918  }
WriteRequest * next_
pointer to next WriteRequest
Definition: AsyncSocket.h:934
def next(obj)
Definition: ast.py:58
void folly::AsyncSocket::WriteRequest::bytesWritten ( size_t  count)
inline

Definition at line 924 of file AsyncSocket.h.

References count, socket_, and uint32_t.

924  {
927  }
AsyncSocket * socket_
parent socket
Definition: AsyncSocket.h:933
uint32_t totalBytesWritten_
total bytes written
Definition: AsyncSocket.h:936
int * count
size_t appBytesWritten_
Num of bytes written to socket.
Definition: AsyncSocket.h:1254
virtual void folly::AsyncSocket::WriteRequest::consume ( )
pure virtual
virtual void folly::AsyncSocket::WriteRequest::destroy ( )
pure virtual
void folly::AsyncSocket::WriteRequest::fail ( const char *  fn,
const AsyncSocketException ex 
)
inline

Definition at line 920 of file AsyncSocket.h.

References socket_.

Referenced by gtest_xml_test_utils.GTestXMLTestCase::_GetChildren(), and fatal_test.FatalTests::is_debug_build().

920  {
921  socket_->failWrite(fn, ex);
922  }
AsyncSocket * socket_
parent socket
Definition: AsyncSocket.h:933
void failWrite(const char *fn, WriteCallback *callback, size_t bytesWritten, const AsyncSocketException &ex)
WriteCallback* folly::AsyncSocket::WriteRequest::getCallback ( ) const
inline

Definition at line 907 of file AsyncSocket.h.

References callback_.

Referenced by folly::AsyncSocket::failAllWrites(), folly::AsyncSocket::failWrite(), and folly::AsyncSocket::handleWrite().

907  {
908  return callback_;
909  }
WriteCallback * callback_
completion callback
Definition: AsyncSocket.h:935
WriteRequest* folly::AsyncSocket::WriteRequest::getNext ( ) const
inline
uint32_t folly::AsyncSocket::WriteRequest::getTotalBytesWritten ( ) const
inline

Definition at line 911 of file AsyncSocket.h.

Referenced by folly::AsyncSocket::failAllWrites(), and folly::AsyncSocket::failWrite().

911  {
912  return totalBytesWritten_;
913  }
uint32_t totalBytesWritten_
total bytes written
Definition: AsyncSocket.h:936
virtual bool folly::AsyncSocket::WriteRequest::isComplete ( )
pure virtual
virtual WriteResult folly::AsyncSocket::WriteRequest::performWrite ( )
pure virtual
virtual void folly::AsyncSocket::WriteRequest::start ( )
inlinevirtual

Member Data Documentation

WriteCallback* folly::AsyncSocket::WriteRequest::callback_
protected

completion callback

Definition at line 935 of file AsyncSocket.h.

WriteRequest* folly::AsyncSocket::WriteRequest::next_ {nullptr}
protected

pointer to next WriteRequest

Definition at line 934 of file AsyncSocket.h.

AsyncSocket* folly::AsyncSocket::WriteRequest::socket_
protected
uint32_t folly::AsyncSocket::WriteRequest::totalBytesWritten_ {0}
protected

total bytes written

Definition at line 936 of file AsyncSocket.h.

Referenced by folly::AsyncSocket::BytesWriteRequest::consume().


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