|
Twitch SDK (Internal)
|
#include <standardopensslsocket.h>
Public Member Functions | |
| OpenSslSocket () | |
| ~OpenSslSocket () | |
| TTV_ErrorCode | Initialize (const std::string &host, const std::string &port) |
| virtual TTV_ErrorCode | Connect () |
| virtual TTV_ErrorCode | Disconnect () |
| virtual TTV_ErrorCode | Send (const uint8_t *buffer, size_t length, size_t &sent) |
| virtual TTV_ErrorCode | Recv (uint8_t *buffer, size_t length, size_t &received) |
| virtual uint64_t | TotalSent () |
| virtual uint64_t | TotalReceived () |
| virtual bool | Connected () |
| TTV_ErrorCode | SetCertificateData (const std::string &data) |
| virtual TTV_ErrorCode | Send (const uint8_t *buffer, size_t length) |
Static Public Member Functions | |
| static TTV_ErrorCode | InitializeOpenSslSockets () |
| static TTV_ErrorCode | ShutdownOpenSslSockets () |
| static void | SetTrustedHosts (const std::vector< std::string > &trustedHosts) |
Private Member Functions | |
| TTV_ErrorCode | PrepareConnection () |
| TTV_ErrorCode | Handshake () |
| TTV_ErrorCode | Flush () |
| TTV_ErrorCode | FlushOutgoing () |
| TTV_ErrorCode | FlushIncoming () |
Private Attributes | |
| std::string | mHost |
| std::string | mPort |
| std::shared_ptr< ISocket > | mBaseSocket |
| std::unique_ptr< SocketData > | mSocketData |
| std::string | mCertificateData |
| bool | mConnected |
Static Private Attributes | |
| static std::vector< std::string > | sTrustedHosts |
This secure socket implements platform-independent TLS communication. Note that it only supports non-blocking IO.
| ttv::OpenSslSocket::OpenSslSocket | ( | ) |
| ttv::OpenSslSocket::~OpenSslSocket | ( | ) |
|
virtual |
Synchronously connects to the endpoint.
Implements ttv::ISocket.
|
virtual |
Determines if the socket is currently connected.
Implements ttv::ISocket.
|
virtual |
Synchronously disconnects from the endpoint. It is safe to call Disconnect() if not connected.
Implements ttv::ISocket.
|
private |
|
private |
|
private |
|
private |
| TTV_ErrorCode ttv::OpenSslSocket::Initialize | ( | const std::string & | host, |
| const std::string & | port | ||
| ) |
|
static |
|
private |
|
virtual |
Attempts to receive some bytes from the socket.
| [in] | buffer | The buffer to store the received bytes in. |
| [in] | length | The largest number of bytes to receive. |
| [out] | received | The number of bytes actually received. |
Implements ttv::ISocket.
|
virtual |
Attempts to send some bytes over the socket. It's possible that the socket is unable to send able to send any more bytes right now but will be in the near future. Thus, the number actually sent may be less than the size of the passed in buffer.
| [in] | buffer | The buffer to store the received bytes in. |
| [in] | length | The number of bytes to send. |
| [out] | sent | The number of bytes actually sent. |
Implements ttv::ISocket.
|
virtualinherited |
Attempts to send some bytes over the socket. This flavor of Send() is a helper which guarantees that all bytes are sent or where is an error on the socket.
| [in] | buffer | The buffer to store the received bytes in. |
| [in] | length | The number of bytes to send. |
Reimplemented in ttv::WinAppSocket.
| TTV_ErrorCode ttv::OpenSslSocket::SetCertificateData | ( | const std::string & | data | ) |
|
static |
Pass in trusted hosts that we allow SSL connections to.
| [in] | List | of strings of hosts that we can trust and verify against. |
|
static |
|
virtual |
Returns the total number of bytes that have been received from the socket during the current connection.
Implements ttv::ISocket.
|
virtual |
Returns the total number of bytes that have been sent over the socket during the current connection.
Implements ttv::ISocket.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
1.8.13