proxygen
folly::SendMsgDataCallback Class Reference

#include <AsyncSSLSocketTest.h>

Inheritance diagram for folly::SendMsgDataCallback:
folly::SendMsgFlagsCallback folly::SendMsgParamsCallbackBase folly::AsyncSocket::SendMsgParamsCallback

Public Member Functions

 SendMsgDataCallback ()
 
void resetData (std::vector< char > &&data)
 
void getAncillaryData (folly::WriteFlags flags, void *data) noexceptoverride
 
uint32_t getAncillaryDataSize (folly::WriteFlags flags) noexceptoverride
 
- Public Member Functions inherited from folly::SendMsgFlagsCallback
 SendMsgFlagsCallback ()
 
void resetFlags (int flags)
 
int getFlagsImpl (folly::WriteFlags flags, int) noexceptoverride
 
- Public Member Functions inherited from folly::SendMsgParamsCallbackBase
 SendMsgParamsCallbackBase ()
 
void setSocket (const std::shared_ptr< AsyncSSLSocket > &socket)
 
- Public Member Functions inherited from folly::AsyncSocket::SendMsgParamsCallback
virtual ~SendMsgParamsCallback ()=default
 
int getFlags (folly::WriteFlags flags, bool zeroCopyEnabled) noexcept
 

Public Attributes

std::vector< char > ancillaryData_
 
- Public Attributes inherited from folly::SendMsgFlagsCallback
int flags_ {0}
 
- Public Attributes inherited from folly::SendMsgParamsCallbackBase
std::shared_ptr< AsyncSSLSocketsocket_
 
folly::AsyncSocket::SendMsgParamsCallbackoldCallback_ {nullptr}
 

Additional Inherited Members

- Static Public Attributes inherited from folly::AsyncSocket::SendMsgParamsCallback
static const size_t maxAncillaryDataSize {0x5000}
 

Detailed Description

Definition at line 100 of file AsyncSSLSocketTest.h.

Constructor & Destructor Documentation

folly::SendMsgDataCallback::SendMsgDataCallback ( )
inline

Definition at line 102 of file AsyncSSLSocketTest.h.

102 {}

Member Function Documentation

void folly::SendMsgDataCallback::getAncillaryData ( folly::WriteFlags  ,
void *   
)
inlineoverridevirtualnoexcept

getAncillaryData() will be invoked to initialize ancillary data buffer referred by "msg_control" field of msghdr structure passed to sendmsg() system call. The function assumes that the size of buffer is not smaller than the value returned by getAncillaryDataSize() method for the same combination of flags.

Parameters
flagsWrite flags requested for the given write operation
dataPointer to ancillary data buffer to initialize.

Reimplemented from folly::SendMsgParamsCallbackBase.

Definition at line 108 of file AsyncSSLSocketTest.h.

References folly::data(), folly::AsyncSocket::SendMsgParamsCallback::getAncillaryData(), and folly::SendMsgParamsCallbackBase::oldCallback_.

108  {
109  if (ancillaryData_.size()) {
110  std::cerr << "getAncillaryData: copying data" << std::endl;
111  memcpy(data, ancillaryData_.data(), ancillaryData_.size());
112  } else {
114  }
115  }
flags
Definition: http_parser.h:127
folly::AsyncSocket::SendMsgParamsCallback * oldCallback_
std::vector< char > ancillaryData_
virtual void getAncillaryData(folly::WriteFlags, void *) noexcept
Definition: AsyncSocket.h:170
constexpr auto data(C &c) -> decltype(c.data())
Definition: Access.h:71
uint32_t folly::SendMsgDataCallback::getAncillaryDataSize ( folly::WriteFlags  )
inlineoverridevirtualnoexcept

getAncillaryDataSize() will be invoked to retrieve the size of ancillary data buffer which should be passed to sendmsg() system call

Parameters
flagsWrite flags requested for the given write operation

Reimplemented from folly::SendMsgParamsCallbackBase.

Definition at line 117 of file AsyncSSLSocketTest.h.

References folly::AsyncSocket::SendMsgParamsCallback::getAncillaryDataSize(), and folly::SendMsgParamsCallbackBase::oldCallback_.

117  {
118  if (ancillaryData_.size()) {
119  std::cerr << "getAncillaryDataSize: returning size" << std::endl;
120  return ancillaryData_.size();
121  } else {
123  }
124  }
flags
Definition: http_parser.h:127
folly::AsyncSocket::SendMsgParamsCallback * oldCallback_
std::vector< char > ancillaryData_
virtual uint32_t getAncillaryDataSize(folly::WriteFlags) noexcept
Definition: AsyncSocket.h:180
void folly::SendMsgDataCallback::resetData ( std::vector< char > &&  data)
inline

Definition at line 104 of file AsyncSSLSocketTest.h.

References folly::data().

Referenced by folly::TEST().

104  {
105  ancillaryData_.swap(data);
106  }
std::vector< char > ancillaryData_

Member Data Documentation

std::vector<char> folly::SendMsgDataCallback::ancillaryData_

Definition at line 126 of file AsyncSSLSocketTest.h.


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