PGE API 0.4
PR00F's Game Engine full documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pge_network::PgeIClient Class Referenceabstract

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

Detailed Description

The primary interface to client networking functionality.

Definition at line 25 of file PgeIClient.h.

#include <PgeIClient.h>

+ Inheritance diagram for pge_network::PgeIClient:

Public Member Functions

virtual bool connectToServer (const std::string &sServerAddress, const std::string &sAppVersion="")=0
 Opens a connection to a server instance.
 
virtual const pge_network::PgeNetworkConnectionHandlegetConnectionHandle () const =0
 Returns client's handle to the connection opened towards the server.
 
virtual const pge_network::PgeNetworkConnectionHandlegetConnectionHandleServerSide () const =0
 Returns server's handle to the connection opened towards this client.
 
virtual const char * getServerAddress () const =0
 
virtual int getPing (bool bForceUpdate)=0
 
virtual float getQualityLocal (bool bForceUpdate)=0
 
virtual float getQualityRemote (bool bForceUpdate)=0
 
virtual float getRxByteRate (bool bForceUpdate)=0
 
virtual float getTxByteRate (bool bForceUpdate)=0
 
virtual int64_t getPendingUnreliableBytes (bool bForceUpdate)=0
 
virtual int64_t getPendingReliableBytes (bool bForceUpdate)=0
 
virtual int64_t getSentButUnAckedReliableBytes (bool bForceUpdate)=0
 
virtual int64_t getInternalQueueTimeUSecs (bool bForceUpdate)=0
 
virtual std::string getDetailedConnectionStatus () 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

◆ connectToServer()

virtual bool pge_network::PgeIClient::connectToServer ( const std::string & sServerAddress,
const std::string & sAppVersion = "" )
pure virtual

Opens a connection to a server instance.

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

Parameters
sServerAddressIPv4 or IPv6 address of PgeServer we want to connect to.
sAppVersionClient application version. If server expects a specific client version, we should fill it here.
Returns
True on success, false otherwise or when it is already connected to server. Note that mismatch between the specified client application version and server application version will be found out later and it does NOT have effect on the return value: the server will disconnect the mismatching client a bit later.

Implemented in pge_network::PgeClientStub, and PgeClientImpl.

◆ getConnectionHandle()

virtual const pge_network::PgeNetworkConnectionHandle & pge_network::PgeIClient::getConnectionHandle ( ) const
pure virtual

Returns client's handle to the connection opened towards the server.

Implemented in pge_network::PgeClientStub, and PgeClientImpl.

◆ getConnectionHandleServerSide()

virtual const pge_network::PgeNetworkConnectionHandle & pge_network::PgeIClient::getConnectionHandleServerSide ( ) const
pure virtual

Returns server's handle to the connection opened towards this client.

Implemented in pge_network::PgeClientStub, and PgeClientImpl.

◆ getDetailedConnectionStatus()

virtual std::string pge_network::PgeIClient::getDetailedConnectionStatus ( ) const
pure virtual

◆ getInternalQueueTimeUSecs()

virtual int64_t pge_network::PgeIClient::getInternalQueueTimeUSecs ( bool bForceUpdate)
pure virtual

◆ getLoggerModuleName()

static const char * pge_network::PgeIClient::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 PgeIClient.h.

◆ getPendingReliableBytes()

virtual int64_t pge_network::PgeIClient::getPendingReliableBytes ( bool bForceUpdate)
pure virtual

◆ getPendingUnreliableBytes()

virtual int64_t pge_network::PgeIClient::getPendingUnreliableBytes ( bool bForceUpdate)
pure virtual

◆ getPing()

virtual int pge_network::PgeIClient::getPing ( bool bForceUpdate)
pure virtual

◆ getQualityLocal()

virtual float pge_network::PgeIClient::getQualityLocal ( bool bForceUpdate)
pure virtual

◆ getQualityRemote()

virtual float pge_network::PgeIClient::getQualityRemote ( bool bForceUpdate)
pure virtual

◆ getRxByteRate()

virtual float pge_network::PgeIClient::getRxByteRate ( bool bForceUpdate)
pure virtual

◆ getSentButUnAckedReliableBytes()

virtual int64_t pge_network::PgeIClient::getSentButUnAckedReliableBytes ( bool bForceUpdate)
pure virtual

◆ getServerAddress()

virtual const char * pge_network::PgeIClient::getServerAddress ( ) const
pure virtual

◆ getTxByteRate()

virtual float pge_network::PgeIClient::getTxByteRate ( bool bForceUpdate)
pure virtual

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