Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cRCONListenCallbacks Class Reference
Inheritance diagram for cRCONListenCallbacks:
Inheritance graph
[legend]
Collaboration diagram for cRCONListenCallbacks:
Collaboration graph
[legend]

Public Member Functions

 cRCONListenCallbacks (cRCONServer &a_RCONServer, UInt16 a_Port)
 
- Public Member Functions inherited from cNetwork::cListenCallbacks
virtual ~cListenCallbacks ()
 

Protected Member Functions

virtual void OnAccepted (cTCPLink &a_Link) override
 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) override
 Called when the socket fails to listen on the specified port. More...
 
virtual cTCPLink::cCallbacksPtr OnIncomingConnection (const AString &a_RemoteIPAddress, UInt16 a_RemotePort) override
 Called when the TCP server created with Listen() receives a new incoming connection. More...
 

Protected Attributes

UInt16 m_Port
 The port for which this instance is responsible. More...
 
cRCONServerm_RCONServer
 The RCON server instance that we're attached to. More...
 

Detailed Description

Definition at line 44 of file RCONServer.cpp.

Constructor & Destructor Documentation

◆ cRCONListenCallbacks()

cRCONListenCallbacks::cRCONListenCallbacks ( cRCONServer a_RCONServer,
UInt16  a_Port 
)
inline

Definition at line 48 of file RCONServer.cpp.

Member Function Documentation

◆ OnAccepted()

virtual void cRCONListenCallbacks::OnAccepted ( cTCPLink a_Link)
inlineoverrideprotectedvirtual

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().

Implements cNetwork::cListenCallbacks.

Definition at line 67 of file RCONServer.cpp.

◆ OnError()

virtual void cRCONListenCallbacks::OnError ( int  a_ErrorCode,
const AString a_ErrorMsg 
)
inlineoverrideprotectedvirtual

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

Implements cNetwork::cListenCallbacks.

Definition at line 68 of file RCONServer.cpp.

◆ OnIncomingConnection()

virtual cTCPLink::cCallbacksPtr cRCONListenCallbacks::OnIncomingConnection ( const AString a_RemoteIPAddress,
UInt16  a_RemotePort 
)
inlineoverrideprotectedvirtual

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.

Implements cNetwork::cListenCallbacks.

Definition at line 62 of file RCONServer.cpp.

Member Data Documentation

◆ m_Port

UInt16 cRCONListenCallbacks::m_Port
protected

The port for which this instance is responsible.

Definition at line 59 of file RCONServer.cpp.

◆ m_RCONServer

cRCONServer& cRCONListenCallbacks::m_RCONServer
protected

The RCON server instance that we're attached to.

Definition at line 56 of file RCONServer.cpp.


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