Implements a secure (SSL/TLS) TCP socket.
The CYITCPSecureSocket class provides methods to send and receive data over a TCP/IP connection in a secure manner by using the SSL protocol. Modern SSL v3.1 has been renamed to TLS v1.1 and the version used is determined by the server but CYITCPSecureSocket is restricted to TLS v1.1 and higher. The default connection timeout (the length of time the secure socket Connect() operation will wait for a connection) is 10 seconds(10000 ms).
#include <network/YiTCPSecureSocket.h>

Public Member Functions | |
| virtual | ~CYITCPSecureSocket () |
| virtual bool | Connect () override |
| virtual bool | Disconnect () override |
| virtual bool | IsConnected () const override |
| virtual IYISocket::SOCKET_RESULT | Send (const char *pBuffer, size_t uLength) override |
| virtual IYISocket::SOCKET_RESULT | Send (const char *pBuffer, size_t uLength, size_t &uSent) override |
| virtual IYISocket::SOCKET_RESULT | Receive (char *pBuffer, size_t uLength, size_t &uReceived) override |
| virtual uint64_t | GetTotalBytesSent () const override |
| virtual uint64_t | GetTotalBytesReceived () const override |
| virtual void | SetConnectionTimeoutMs (uint32_t uTimeoutMs) override |
| virtual uint32_t | GetConnectionTimeoutMs () const override |
| virtual bool | SetSocketBlockingEnabled (bool bBlocking) override |
Public Member Functions inherited from IYISocket | |
| virtual | ~IYISocket () |
Static Public Member Functions | |
| static std::unique_ptr< CYITCPSecureSocket > | Create (const CYIString &host, uint16_t uPort) |
Static Public Member Functions inherited from IYISocket | |
| static bool | SOCKET_OPERATION_SUCCEEDED (SOCKET_RESULT eResult) |
Protected Member Functions | |
| CYITCPSecureSocket (const CYIString &host, uint16_t uPort) | |
Additional Inherited Members | |
Public Types inherited from IYISocket | |
| enum | SOCKET_RESULT { YI_SOCKET_SUCCESS, YI_SOCKET_ERROR, YI_SOCKET_NOT_CONNECTED, YI_SOCKET_CLOSE, YI_SOCKET_WOULD_BLOCK } |
| Possible return values from socket operations. More... | |
|
virtual |
|
protected |
|
overridevirtual |
Initiates a connection based on the socket's address and configuration. Returns true if successful.
Implements IYISocket.
|
static |
Factory method to create a secure socket based on the host and uPort passed in. Returns the created CYITCPSecureSocket.
|
overridevirtual |
Closes the connection on the socket. Returns true if successful.
Implements IYISocket.
|
overridevirtual |
Returns the timeout length in milliseconds.
Implements IYISocket.
|
overridevirtual |
Returns the total number of bytes received during the lifetime of the socket.
Implements IYISocket.
|
overridevirtual |
Returns the total number of bytes sent during the lifetime of the socket.
Implements IYISocket.
|
overridevirtual |
Returns true if the socket is connected.
Implements IYISocket.
|
overridevirtual |
Receives a character buffer, pBuffer from a socket, passing in the length,nLength, of the buffer. nReceived is an output parameter representing the number of bytes successfully received. Returns SOCKET_RESULT to indicate socket operation result.
Implements IYISocket.
|
overridevirtual |
Sends a character buffer, pBuffer along with the buffer length, nLength, to the socket. Returns SOCKET_RESULT to indicate socket operation result.
Implements IYISocket.
|
overridevirtual |
Sends a character buffer, pBuffer along with the buffer length, nLength, to the socket. nSent is an output parameter representing the number of bytes that were successfully sent. Returns SOCKET_RESULT to indicate socket operation result.
Implements IYISocket.
|
overridevirtual |
Sets the length of time in milliseconds uTimeoutMs that the socket will wait for a connection before aborting the Connect() operation. The default timeout is set to 10 seconds (10000 ms).
Implements IYISocket.
|
overridevirtual |
Utility method modifying the socket's internal flags base on bBlocking. When bBlocking is true, further calls to Send(), Receive(), Connect() and Accept() on the socket will block until a response is received. The default state when a socket is created is blocking. Returns true if the call succeeded.
Implements IYISocket.