proxygen
folly::AlpnClient Class Reference

#include <AsyncSSLSocketTest.h>

Inheritance diagram for folly::AlpnClient:
folly::AsyncSSLSocket::HandshakeCB folly::AsyncWriter::WriteCallback

Public Member Functions

 AlpnClient (AsyncSSLSocket::UniquePtr socket)
 

Public Attributes

const unsigned char * nextProto
 
unsigned nextProtoLength
 
folly::Optional< AsyncSocketExceptionexcept
 

Private Member Functions

void handshakeSuc (AsyncSSLSocket *) noexceptoverride
 
void handshakeErr (AsyncSSLSocket *, const AsyncSocketException &ex) noexceptoverride
 
void writeSuccess () noexceptoverride
 
void writeErr (size_t bytesWritten, const AsyncSocketException &ex) noexceptoverride
 
- Private Member Functions inherited from folly::AsyncSSLSocket::HandshakeCB
virtual ~HandshakeCB ()=default
 
virtual bool handshakeVer (AsyncSSLSocket *, bool preverifyOk, X509_STORE_CTX *) noexcept
 
- Private Member Functions inherited from folly::AsyncWriter::WriteCallback
virtual ~WriteCallback ()=default
 

Private Attributes

AsyncSSLSocket::UniquePtr socket_
 

Detailed Description

Definition at line 917 of file AsyncSSLSocketTest.h.

Constructor & Destructor Documentation

folly::AlpnClient::AlpnClient ( AsyncSSLSocket::UniquePtr  socket)
inlineexplicit

Definition at line 920 of file AsyncSSLSocketTest.h.

References folly::SendMsgParamsCallbackBase::socket_.

921  : nextProto(nullptr), nextProtoLength(0), socket_(std::move(socket)) {
922  socket_->sslConn(this);
923  }
constexpr detail::Map< Move > move
Definition: Base-inl.h:2567
AsyncSSLSocket::UniquePtr socket_
NetworkSocket socket(int af, int type, int protocol)
Definition: NetOps.cpp:412
const unsigned char * nextProto

Member Function Documentation

void folly::AlpnClient::handshakeErr ( AsyncSSLSocket sock,
const AsyncSocketException ex 
)
inlineoverrideprivatevirtualnoexcept

handshakeErr() is called if an error occurs while establishing the SSL connection.

The HandshakeCB will be uninstalled before handshakeErr() is called.

Parameters
sockSSL socket on which the handshake was initiated
exAn exception representing the error.

Implements folly::AsyncSSLSocket::HandshakeCB.

Definition at line 933 of file AsyncSSLSocketTest.h.

935  {
936  except = ex;
937  }
folly::Optional< AsyncSocketException > except
void folly::AlpnClient::handshakeSuc ( AsyncSSLSocket sock)
inlineoverrideprivatevirtualnoexcept

handshakeSuc() is called when a new SSL connection is established, i.e., after SSL_accept/connect() returns successfully.

The HandshakeCB will be uninstalled before handshakeSuc() is called.

Parameters
sockSSL socket on which the handshake was initiated

Implements folly::AsyncSSLSocket::HandshakeCB.

Definition at line 930 of file AsyncSSLSocketTest.h.

References folly::SendMsgParamsCallbackBase::socket_.

930  {
931  socket_->getSelectedNextProtocol(&nextProto, &nextProtoLength);
932  }
AsyncSSLSocket::UniquePtr socket_
const unsigned char * nextProto
void folly::AlpnClient::writeErr ( size_t  bytesWritten,
const 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 941 of file AsyncSSLSocketTest.h.

References ADD_FAILURE.

943  {
944  ADD_FAILURE() << "client write error after " << bytesWritten
945  << " bytes: " << ex.what();
946  }
#define ADD_FAILURE()
Definition: gtest.h:1808
void folly::AlpnClient::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 938 of file AsyncSSLSocketTest.h.

References folly::SendMsgParamsCallbackBase::socket_.

938  {
939  socket_->close();
940  }
AsyncSSLSocket::UniquePtr socket_

Member Data Documentation

folly::Optional<AsyncSocketException> folly::AlpnClient::except

Definition at line 927 of file AsyncSSLSocketTest.h.

const unsigned char* folly::AlpnClient::nextProto

Definition at line 925 of file AsyncSSLSocketTest.h.

unsigned folly::AlpnClient::nextProtoLength

Definition at line 926 of file AsyncSSLSocketTest.h.

AsyncSSLSocket::UniquePtr folly::AlpnClient::socket_
private

Definition at line 948 of file AsyncSSLSocketTest.h.


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