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

Public Member Functions

 cHTTPServerListenCallbacks (cHTTPServer &a_HTTPServer, 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

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

Detailed Description

Definition at line 31 of file HTTPServer.cpp.

Constructor & Destructor Documentation

◆ cHTTPServerListenCallbacks()

cHTTPServerListenCallbacks::cHTTPServerListenCallbacks ( cHTTPServer a_HTTPServer,
UInt16  a_Port 
)
inline

Definition at line 35 of file HTTPServer.cpp.

Member Function Documentation

◆ OnAccepted()

virtual void cHTTPServerListenCallbacks::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 53 of file HTTPServer.cpp.

◆ OnError()

virtual void cHTTPServerListenCallbacks::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 54 of file HTTPServer.cpp.

◆ OnIncomingConnection()

virtual cTCPLink::cCallbacksPtr cHTTPServerListenCallbacks::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 49 of file HTTPServer.cpp.

Member Data Documentation

◆ m_HTTPServer

cHTTPServer& cHTTPServerListenCallbacks::m_HTTPServer
protected

The HTTP server instance that we're attached to.

Definition at line 43 of file HTTPServer.cpp.

◆ m_Port

UInt16 cHTTPServerListenCallbacks::m_Port
protected

The port for which this instance is responsible.

Definition at line 46 of file HTTPServer.cpp.


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