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

Callbacks used when listening for incoming connections as a server. More...

#include <Network.h>

Inheritance diagram for cNetwork::cListenCallbacks:
Inheritance graph
[legend]

Public Member Functions

virtual void OnAccepted (cTCPLink &a_Link)=0
 Called when the TCP server created with Listen() creates a new link for an incoming connection. More...
 
virtual void OnError (int a_ErrorCode, const AString &a_ErrorMsg)=0
 Called when the socket fails to listen on the specified port. More...
 
virtual cTCPLink::cCallbacksPtr OnIncomingConnection (const AString &a_RemoteIPAddress, UInt16 a_RemotePort)=0
 Called when the TCP server created with Listen() receives a new incoming connection. More...
 
virtual ~cListenCallbacks ()
 

Detailed Description

Callbacks used when listening for incoming connections as a server.

Definition at line 253 of file Network.h.

Constructor & Destructor Documentation

◆ ~cListenCallbacks()

virtual cNetwork::cListenCallbacks::~cListenCallbacks ( )
inlinevirtual

Definition at line 257 of file Network.h.

Member Function Documentation

◆ OnAccepted()

virtual void cNetwork::cListenCallbacks::OnAccepted ( cTCPLink a_Link)
pure virtual

Called when the TCP server created with Listen() creates a new link for an incoming connection.

Provides the newly created Link that can be used for communication. Called right after a successful OnIncomingConnection().

Implemented in cServerListenCallbacks, cRCONListenCallbacks, cHTTPServerListenCallbacks, and cLuaServerHandle.

◆ OnError()

virtual void cNetwork::cListenCallbacks::OnError ( int  a_ErrorCode,
const AString a_ErrorMsg 
)
pure virtual

Called when the socket fails to listen on the specified port.

Implemented in cServerListenCallbacks, cRCONListenCallbacks, cHTTPServerListenCallbacks, and cLuaServerHandle.

◆ OnIncomingConnection()

virtual cTCPLink::cCallbacksPtr cNetwork::cListenCallbacks::OnIncomingConnection ( const AString a_RemoteIPAddress,
UInt16  a_RemotePort 
)
pure virtual

Called when the TCP server created with Listen() receives a new incoming connection.

Returns the link callbacks that the server should use for the newly created link. If a nullptr is returned, the connection is dropped immediately; otherwise a new cTCPLink instance is created and OnAccepted() is called.

Implemented in cServerListenCallbacks, cRCONListenCallbacks, cHTTPServerListenCallbacks, and cLuaServerHandle.


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