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

#include <Network.h>

Inheritance diagram for cTCPLink::cCallbacks:
Inheritance graph
[legend]

Public Member Functions

virtual void OnError (int a_ErrorCode, const AString &a_ErrorMsg)=0
 Called when an error is detected on the connection. More...
 
virtual void OnLinkCreated (cTCPLinkPtr a_Link)=0
 Called when the cTCPLink for the connection is created. More...
 
virtual void OnReceivedData (const char *a_Data, size_t a_Length)=0
 Called when there's data incoming from the remote peer. More...
 
virtual void OnRemoteClosed (void)=0
 Called when the remote end closes the connection. More...
 
virtual void OnTlsHandshakeCompleted (void)
 Called when the TLS handshake has been completed and communication can continue regularly. More...
 
virtual ~cCallbacks ()
 

Detailed Description

Definition at line 46 of file Network.h.

Constructor & Destructor Documentation

◆ ~cCallbacks()

virtual cTCPLink::cCallbacks::~cCallbacks ( )
inlinevirtual

Definition at line 50 of file Network.h.

Member Function Documentation

◆ OnError()

virtual void cTCPLink::cCallbacks::OnError ( int  a_ErrorCode,
const AString a_ErrorMsg 
)
pure virtual

Called when an error is detected on the connection.

Implemented in cRCONServer::cConnection, cBlockingSslClientSocketLinkCallbacks, cUrlClientRequest, cHTTPServerConnection, cClientHandle, and cLuaTCPLink.

◆ OnLinkCreated()

virtual void cTCPLink::cCallbacks::OnLinkCreated ( cTCPLinkPtr  a_Link)
pure virtual

Called when the cTCPLink for the connection is created.

The callback may store the cTCPLink instance for later use, but it should remove it in OnError(), OnRemoteClosed() or right after Close().

Implemented in cRCONServer::cConnection, cBlockingSslClientSocketLinkCallbacks, cUrlClientRequest, cHTTPServerConnection, cClientHandle, and cLuaTCPLink.

◆ OnReceivedData()

virtual void cTCPLink::cCallbacks::OnReceivedData ( const char *  a_Data,
size_t  a_Length 
)
pure virtual

◆ OnRemoteClosed()

virtual void cTCPLink::cCallbacks::OnRemoteClosed ( void  )
pure virtual

Called when the remote end closes the connection.

The link is still available for connection information query (IP / port). Sending data on the link is not an error, but the data won't be delivered.

Implemented in cRCONServer::cConnection, cBlockingSslClientSocketLinkCallbacks, cUrlClientRequest, cHTTPServerConnection, cClientHandle, and cLuaTCPLink.

◆ OnTlsHandshakeCompleted()

virtual void cTCPLink::cCallbacks::OnTlsHandshakeCompleted ( void  )
inlinevirtual

Called when the TLS handshake has been completed and communication can continue regularly.

Has an empty default implementation, so that link callback descendants don't need to specify TLS handlers when they don't use TLS at all.

Reimplemented in cUrlClientRequest.

Definition at line 66 of file Network.h.


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