PGE API 0.4
PR00F's Game Engine full documentation
Loading...
Searching...
No Matches
pge_network::PgeIServer Class Referenceabstract

The primary interface to server networking functionality. More...

Detailed Description

The primary interface to server networking functionality.

Definition at line 25 of file PgeIServer.h.

#include <PgeIServer.h>

+ Inheritance diagram for pge_network::PgeIServer:

Public Member Functions

virtual bool startListening (const std::string &sAppVersion="")=0
 Starts listening to incoming PgeClient connections.
 
virtual void sendToAllClientsExcept (const pge_network::PgePacket &pkt, const pge_network::PgeNetworkConnectionHandle &exceptConnHandle=pge_network::ServerConnHandle)=0
 Sends the given packet to all client instances except the optionally specified client.
 
virtual void sendToAll (const pge_network::PgePacket &pkt)=0
 Sends the given packet to all known network instances, including the server itself (self).
 
virtual void setDebugNickname (const pge_network::PgeNetworkConnectionHandle &connHandle, const std::string &sNickname)=0
 Sets a debug helper name associated to the given connection handle.
 
virtual int getPing (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate)=0
 
virtual float getQualityLocal (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate)=0
 
virtual float getQualityRemote (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate)=0
 
virtual float getRxByteRate (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate)=0
 
virtual float getTxByteRate (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate)=0
 
virtual int64_t getPendingUnreliableBytes (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate)=0
 
virtual int64_t getPendingReliableBytes (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate)=0
 
virtual int64_t getSentButUnAckedReliableBytes (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate)=0
 
virtual int64_t getInternalQueueTimeUSecs (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate)=0
 
virtual std::string getDetailedConnectionStatus (const pge_network::PgeNetworkConnectionHandle &connHandle) const =0
 
- Public Member Functions inherited from pge_network::PgeIServerClient
virtual bool initialize ()=0
 Initialize the network instance.
 
virtual bool shutdown ()=0
 This stops the network instance.
 
virtual bool isInitialized () const =0
 Gets the state of the network instance.
 
virtual void disconnect (const std::string &sExtraDebugText="")=0
 Terminates the active connection of the network instance.
 
virtual void Update ()=0
 
virtual bool pollIncomingMessages ()=0
 Moves incoming packets from the underlying network layer to PGE network layer as PgePackets.
 
virtual void pollConnectionStateChanges ()=0
 
virtual std::size_t getPacketQueueSize () const =0
 
virtual pge_network::PgePacket popFrontPacket () noexcept(false)=0
 
virtual std::set< pge_network::PgePktId > & getAllowListedPgeMessages ()=0
 
virtual std::set< pge_network::MsgApp::TMsgId > & getAllowListedAppMessages ()=0
 
virtual void send (const pge_network::PgePacket &pkt, const pge_network::PgeNetworkConnectionHandle &connHandle=pge_network::ServerConnHandle)=0
 Sends the given packet to the network instance specified.
 
virtual uint32_t getRxPacketCount () const =0
 
virtual uint32_t getTxPacketCount () const =0
 
virtual uint32_t getInjectPacketCount () const =0
 
virtual uint32_t getRxPacketPerSecondCount () const =0
 
virtual uint32_t getTxPacketPerSecondCount () const =0
 
virtual uint32_t getInjectPacketPerSecondCount () const =0
 
virtual const std::map< pge_network::MsgApp::TMsgId, uint32_t > & getRxMsgCount () const =0
 
virtual const std::map< pge_network::MsgApp::TMsgId, uint32_t > & getTxMsgCount () const =0
 
virtual const std::map< pge_network::MsgApp::TMsgId, uint32_t > & getInjectMsgCount () const =0
 
virtual std::map< pge_network::MsgApp::TMsgId, std::string > & getMsgAppId2StringMap ()=0
 
virtual uint32_t getRxByteCount () const =0
 
virtual uint32_t getTxByteCount () const =0
 
virtual uint32_t getInjectByteCount () const =0
 
virtual void WriteList () const =0
 Writes statistics to console.
 

Static Public Member Functions

static const char * getLoggerModuleName ()
 Returns the logger module name of this class.
 

Member Function Documentation

◆ getDetailedConnectionStatus()

virtual std::string pge_network::PgeIServer::getDetailedConnectionStatus ( const pge_network::PgeNetworkConnectionHandle & connHandle) const
pure virtual

◆ getInternalQueueTimeUSecs()

virtual int64_t pge_network::PgeIServer::getInternalQueueTimeUSecs ( const pge_network::PgeNetworkConnectionHandle & connHandle,
bool bForceUpdate )
pure virtual

◆ getLoggerModuleName()

static const char * pge_network::PgeIServer::getLoggerModuleName ( )
inlinestatic

Returns the logger module name of this class.

Not private, so user can also access this from outside, for any reason like controlling log filtering per logger module name.

Returns
The logger module name of this class.

Definition at line 39 of file PgeIServer.h.

◆ getPendingReliableBytes()

virtual int64_t pge_network::PgeIServer::getPendingReliableBytes ( const pge_network::PgeNetworkConnectionHandle & connHandle,
bool bForceUpdate )
pure virtual

◆ getPendingUnreliableBytes()

virtual int64_t pge_network::PgeIServer::getPendingUnreliableBytes ( const pge_network::PgeNetworkConnectionHandle & connHandle,
bool bForceUpdate )
pure virtual

◆ getPing()

virtual int pge_network::PgeIServer::getPing ( const pge_network::PgeNetworkConnectionHandle & connHandle,
bool bForceUpdate )
pure virtual

◆ getQualityLocal()

virtual float pge_network::PgeIServer::getQualityLocal ( const pge_network::PgeNetworkConnectionHandle & connHandle,
bool bForceUpdate )
pure virtual

◆ getQualityRemote()

virtual float pge_network::PgeIServer::getQualityRemote ( const pge_network::PgeNetworkConnectionHandle & connHandle,
bool bForceUpdate )
pure virtual

◆ getRxByteRate()

virtual float pge_network::PgeIServer::getRxByteRate ( const pge_network::PgeNetworkConnectionHandle & connHandle,
bool bForceUpdate )
pure virtual

◆ getSentButUnAckedReliableBytes()

virtual int64_t pge_network::PgeIServer::getSentButUnAckedReliableBytes ( const pge_network::PgeNetworkConnectionHandle & connHandle,
bool bForceUpdate )
pure virtual

◆ getTxByteRate()

virtual float pge_network::PgeIServer::getTxByteRate ( const pge_network::PgeNetworkConnectionHandle & connHandle,
bool bForceUpdate )
pure virtual

◆ sendToAll()

virtual void pge_network::PgeIServer::sendToAll ( const pge_network::PgePacket & pkt)
pure virtual

Sends the given packet to all known network instances, including the server itself (self).

Basically equals to: send(pkt); sendToAllClientsExcept(pkt);

Parameters
pktThe packet to be sent.

Implemented in pge_network::PgeServerStub, and PgeServerImpl.

◆ sendToAllClientsExcept()

virtual void pge_network::PgeIServer::sendToAllClientsExcept ( const pge_network::PgePacket & pkt,
const pge_network::PgeNetworkConnectionHandle & exceptConnHandle = pge_network::ServerConnHandle )
pure virtual

Sends the given packet to all client instances except the optionally specified client.

This function is never able to send to server, not even injecting, hence the name contains "Clients".

Parameters
pktThe packet to be sent.
exceptConnHandleThe server-side connection of handle of a client to which we DO NOT want to send the packet. Since this function never sends to server, we use pge_network::ServerConnHandle as default, in such case the packet is sent to all clients. Even if you specify a real server-side connection handle of a client, this packet will never be sent to server, that is why function name contains "Clients".

Implemented in pge_network::PgeServerStub, and PgeServerImpl.

◆ setDebugNickname()

virtual void pge_network::PgeIServer::setDebugNickname ( const pge_network::PgeNetworkConnectionHandle & connHandle,
const std::string & sNickname )
pure virtual

Sets a debug helper name associated to the given connection handle.

Useful because it makes reading debug log easier when not only connection handle but also this debug helper name is also logged. Can be anything, for example it can be the same name as the player name on higher application level associated to this connection.

Parameters
connHandleThe connection for which we want to set the debug helper name. Cannot be ServerConnHandle.
sNicknameThe debug helper name we want to see associated to the specified connection in the debug logs.

Implemented in pge_network::PgeServerStub, and PgeServerImpl.

◆ startListening()

virtual bool pge_network::PgeIServer::startListening ( const std::string & sAppVersion = "")
pure virtual

Starts listening to incoming PgeClient connections.

If the function is successful, any call to the derived isListening() is expected to return true. Note: you can stop listening by invoking the derived disconnect() or shutdown() which are implemented already in hidden class.

Parameters
sAppVersionServer application version. We should fill it in if we expect connecting clients to have this same application version.
Returns
True on success, false otherwise or when it is already listening.

Implemented in pge_network::PgeServerStub, and PgeServerImpl.


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