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

Public Member Functions

 cServerListenCallbacks (cServer &a_Server, UInt16 a_Port)
 
- Public Member Functions inherited from cNetwork::cListenCallbacks
virtual ~cListenCallbacks ()
 

Private 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...
 

Private Attributes

UInt16 m_Port
 
cServerm_Server
 

Detailed Description

Definition at line 34 of file Server.cpp.

Constructor & Destructor Documentation

◆ cServerListenCallbacks()

cServerListenCallbacks::cServerListenCallbacks ( cServer a_Server,
UInt16  a_Port 
)
inline

Definition at line 53 of file Server.cpp.

Member Function Documentation

◆ OnAccepted()

virtual void cServerListenCallbacks::OnAccepted ( cTCPLink a_Link)
inlineoverrideprivatevirtual

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 45 of file Server.cpp.

◆ OnError()

virtual void cServerListenCallbacks::OnError ( int  a_ErrorCode,
const AString a_ErrorMsg 
)
inlineoverrideprivatevirtual

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

Implements cNetwork::cListenCallbacks.

Definition at line 47 of file Server.cpp.

◆ OnIncomingConnection()

virtual cTCPLink::cCallbacksPtr cServerListenCallbacks::OnIncomingConnection ( const AString a_RemoteIPAddress,
UInt16  a_RemotePort 
)
inlineoverrideprivatevirtual

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 40 of file Server.cpp.

Member Data Documentation

◆ m_Port

UInt16 cServerListenCallbacks::m_Port
private

Definition at line 38 of file Server.cpp.

◆ m_Server

cServer& cServerListenCallbacks::m_Server
private

Definition at line 37 of file Server.cpp.


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