proxygen
|
#include <AsyncSSLSocketTest.h>
Public Member Functions | |
SSLClient (EventBase *eventBase, const folly::SocketAddress &address, uint32_t requests, uint32_t timeout=0) | |
~SSLClient () override | |
uint32_t | getHit () const |
uint32_t | getMiss () const |
uint32_t | getErrors () const |
uint32_t | getWriteAfterConnectErrors () const |
void | connect (bool writeNow=false) |
void | connectSuccess () noexceptoverride |
void | connectErr (const AsyncSocketException &ex) noexceptoverride |
void | writeSuccess () noexceptoverride |
void | writeErr (size_t, const AsyncSocketException &ex) noexceptoverride |
void | getReadBuffer (void **bufReturn, size_t *lenReturn) override |
void | readEOF () noexceptoverride |
void | readErr (const AsyncSocketException &ex) noexceptoverride |
void | readDataAvailable (size_t len) noexceptoverride |
Public Member Functions inherited from folly::AsyncSocket::ConnectCallback | |
virtual | ~ConnectCallback ()=default |
Public Member Functions inherited from folly::AsyncWriter::WriteCallback | |
virtual | ~WriteCallback ()=default |
Public Member Functions inherited from folly::AsyncReader::ReadCallback | |
virtual | ~ReadCallback ()=default |
virtual bool | isBufferMovable () noexcept |
virtual size_t | maxBufferSize () const |
virtual void | readBufferAvailable (std::unique_ptr< IOBuf >) noexcept |
Private Attributes | |
EventBase * | eventBase_ |
std::shared_ptr< AsyncSSLSocket > | sslSocket_ |
SSL_SESSION * | session_ |
std::shared_ptr< folly::SSLContext > | ctx_ |
uint32_t | requests_ |
folly::SocketAddress | address_ |
uint32_t | timeout_ |
char | buf_ [128] |
char | readbuf_ [128] |
uint32_t | bytesRead_ |
uint32_t | hit_ |
uint32_t | miss_ |
uint32_t | errors_ |
uint32_t | writeAfterConnectErrors_ |
Static Private Attributes | |
static constexpr size_t | kMaxReadsPerEvent = 2 |
static constexpr size_t | kMaxReadBufferSz |
Definition at line 1117 of file AsyncSSLSocketTest.h.
|
inline |
Definition at line 1145 of file AsyncSSLSocketTest.h.
References folly::SocketAddress::reset(), and folly::detail::timeout.
|
inlineoverride |
|
inline |
Definition at line 1191 of file AsyncSSLSocketTest.h.
References folly::AsyncSSLSocket::newSocket().
|
inlineoverridevirtualnoexcept |
connectErr() will be invoked if the connection attempt fails.
ex | An exception describing the error that occurred. |
Implements folly::AsyncSocket::ConnectCallback.
Definition at line 1224 of file AsyncSSLSocketTest.h.
|
inlineoverridevirtualnoexcept |
connectSuccess() will be invoked when the connection has been successfully established.
Implements folly::AsyncSocket::ConnectCallback.
Definition at line 1204 of file AsyncSSLSocketTest.h.
|
inline |
Definition at line 1183 of file AsyncSSLSocketTest.h.
|
inline |
Definition at line 1175 of file AsyncSSLSocketTest.h.
|
inline |
Definition at line 1179 of file AsyncSSLSocketTest.h.
|
inlineoverridevirtual |
When data becomes available, getReadBuffer() will be invoked to get the buffer into which data should be read.
This method allows the ReadCallback to delay buffer allocation until data becomes available. This allows applications to manage large numbers of idle connections, without having to maintain a separate read buffer for each idle connection.
It is possible that in some cases, getReadBuffer() may be called multiple times before readDataAvailable() is invoked. In this case, the data will be written to the buffer returned from the most recent call to readDataAvailable(). If the previous calls to readDataAvailable() returned different buffers, the ReadCallback is responsible for ensuring that they are not leaked.
If getReadBuffer() throws an exception, returns a nullptr buffer, or returns a 0 length, the ReadCallback will be uninstalled and its readError() method will be invoked.
getReadBuffer() is not allowed to change the transport state before it returns. (For example, it should never uninstall the read callback, or set a different read callback.)
bufReturn | getReadBuffer() should update *bufReturn to contain the address of the read buffer. This parameter will never be nullptr. |
lenReturn | getReadBuffer() should update *lenReturn to contain the maximum number of bytes that may be written to the read buffer. This parameter will never be nullptr. |
Implements folly::AsyncReader::ReadCallback.
Definition at line 1243 of file AsyncSSLSocketTest.h.
References min.
|
inline |
Definition at line 1187 of file AsyncSSLSocketTest.h.
|
inlineoverridevirtualnoexcept |
readDataAvailable() will be invoked when data has been successfully read into the buffer returned by the last call to getReadBuffer().
The read callback remains installed after readDataAvailable() returns. It must be explicitly uninstalled to stop receiving read events. getReadBuffer() will be called at least once before each call to readDataAvailable(). getReadBuffer() will also be called before any call to readEOF().
len | The number of bytes placed in the buffer. |
Implements folly::AsyncReader::ReadCallback.
Definition at line 1256 of file AsyncSSLSocketTest.h.
References folly::netops::connect(), and EXPECT_EQ.
|
inlineoverridevirtualnoexcept |
readEOF() will be invoked when the transport is closed.
The read callback will be automatically uninstalled immediately before readEOF() is invoked.
Implements folly::AsyncReader::ReadCallback.
Definition at line 1248 of file AsyncSSLSocketTest.h.
|
inlineoverridevirtualnoexcept |
readError() will be invoked if an error occurs reading from the transport.
The read callback will be automatically uninstalled immediately before readError() is invoked.
ex | An exception describing the error that occurred. |
Implements folly::AsyncReader::ReadCallback.
Definition at line 1252 of file AsyncSSLSocketTest.h.
|
inlineoverridevirtualnoexcept |
writeError() will be invoked if an error occurs writing the data.
bytesWritten | The number of bytes that were successfull |
ex | An exception describing the error that occurred. |
Implements folly::AsyncWriter::WriteCallback.
Definition at line 1234 of file AsyncSSLSocketTest.h.
|
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 1230 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1126 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1128 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1130 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1124 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1133 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1121 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1131 of file AsyncSSLSocketTest.h.
|
staticprivate |
Definition at line 1141 of file AsyncSSLSocketTest.h.
|
staticprivate |
Definition at line 1139 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1132 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1129 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1125 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1123 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1122 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1127 of file AsyncSSLSocketTest.h.
|
private |
Definition at line 1134 of file AsyncSSLSocketTest.h.