Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | List of all members
cCallbackSslContext::cDataCallbacks Class Referenceabstract

Interface used as a data sink for the SSL peer data. More...

#include <CallbackSslContext.h>

Inheritance diagram for cCallbackSslContext::cDataCallbacks:
Inheritance graph
[legend]

Public Member Functions

virtual int ReceiveEncrypted (unsigned char *a_Buffer, size_t a_NumBytes)=0
 Called when mbedTLS wants to read encrypted data from the SSL peer. More...
 
virtual int SendEncrypted (const unsigned char *a_Buffer, size_t a_NumBytes)=0
 Called when mbedTLS wants to write encrypted data to the SSL peer. More...
 
virtual ~cDataCallbacks ()
 

Detailed Description

Interface used as a data sink for the SSL peer data.

Definition at line 24 of file CallbackSslContext.h.

Constructor & Destructor Documentation

◆ ~cDataCallbacks()

virtual cCallbackSslContext::cDataCallbacks::~cDataCallbacks ( )
inlinevirtual

Definition at line 28 of file CallbackSslContext.h.

Member Function Documentation

◆ ReceiveEncrypted()

virtual int cCallbackSslContext::cDataCallbacks::ReceiveEncrypted ( unsigned char *  a_Buffer,
size_t  a_NumBytes 
)
pure virtual

Called when mbedTLS wants to read encrypted data from the SSL peer.

The returned value is the number of bytes received, or a mbedTLS error on failure. The implementation can return MBEDTLS_ERR_SSL_WANT_READ or MBEDTLS_ERR_SSL_WANT_WRITE to indicate that there's currently no more data and that there might be more data in the future. In such cases the SSL operation that invoked this call will terminate with the same return value, so that the owner is notified of this condition and can potentially restart the operation later on.

Implemented in cBlockingSslClientSocket.

◆ SendEncrypted()

virtual int cCallbackSslContext::cDataCallbacks::SendEncrypted ( const unsigned char *  a_Buffer,
size_t  a_NumBytes 
)
pure virtual

Called when mbedTLS wants to write encrypted data to the SSL peer.

The returned value is the number of bytes sent, or a mbedTLS error on failure. The implementation can return MBEDTLS_ERR_SSL_WANT_READ or MBEDTLS_ERR_SSL_WANT_WRITE to indicate that there's currently no more data and that there might be more data in the future. In such cases the SSL operation that invoked this call will terminate with the same return value, so that the owner is notified of this condition and can potentially restart the operation later on.

Implemented in cBlockingSslClientSocket.


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