Zappy Server
C++ game server: world, rules, scheduler, network
Loading...
Searching...
No Matches
INetworkObserver Class Referenceabstract

Observer hooks for raw socket events (Observer pattern). More...

#include <INetworkObserver.hpp>

+ Inheritance diagram for INetworkObserver:
+ Collaboration diagram for INetworkObserver:

Public Member Functions

virtual ~INetworkObserver ()=default
 
virtual void onClientConnected (int connectionId)=0
 A new client socket was accepted (assigned connectionId).
 
virtual void onClientDisconnected (int connectionId)=0
 A client socket closed or errored.
 
virtual void onLineReceived (int connectionId, const std::string &line)=0
 One complete '
'-terminated line arrived from the client.
 
virtual void onLineSent (int connectionId, const std::string &line)=0
 One line was queued to be sent to the client.
 

Detailed Description

Observer hooks for raw socket events (Observer pattern).

ClientManager calls these when a socket connects, drops, or moves a line, so observers can react to traffic without ClientManager knowing about them.

Definition at line 11 of file INetworkObserver.hpp.

Constructor & Destructor Documentation

◆ ~INetworkObserver()

virtual INetworkObserver::~INetworkObserver ( )
virtualdefault

Member Function Documentation

◆ onClientConnected()

virtual void INetworkObserver::onClientConnected ( int  connectionId)
pure virtual

A new client socket was accepted (assigned connectionId).

Implemented in LogObserver.

◆ onClientDisconnected()

virtual void INetworkObserver::onClientDisconnected ( int  connectionId)
pure virtual

A client socket closed or errored.

Implemented in LogObserver.

◆ onLineReceived()

virtual void INetworkObserver::onLineReceived ( int  connectionId,
const std::string &  line 
)
pure virtual

One complete '
'-terminated line arrived from the client.

Implemented in LogObserver.

◆ onLineSent()

virtual void INetworkObserver::onLineSent ( int  connectionId,
const std::string &  line 
)
pure virtual

One line was queued to be sent to the client.

Implemented in LogObserver.


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