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

PGE Network Client and Server Common Interface class. More...

Detailed Description

PGE Network Client and Server Common Interface class.

Let the application be either client or server, it is supposed to access functionality through this common interface.

Definition at line 32 of file PgeIServerClient.h.

#include <PgeIServerClient.h>

+ Inheritance diagram for pge_network::PgeIServerClient:

Public Member Functions

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.
 

Member Function Documentation

◆ disconnect()

virtual void pge_network::PgeIServerClient::disconnect ( const std::string & sExtraDebugText = "")
pure virtual

Terminates the active connection of the network instance.

In case of server instance, this terminates the active connections of the server instance and stops listening. It also sends as many MsgUserDisconnectedFromServer to all clients as the number of clients, so all clients will be notified about all other clients disconnecting. A MsgUserDisconnectedFromServer will be injected into the message queue with the server's connection handle, so at application level the handleUserDisconnected() is expected to be invoked with connHandleServerSide = pge_network::ServerConnHandle.

In case of client instance, this disconnects the client from the server. If client was connected at time of calling this function, a MsgUserDisconnectedFromServer will be injected into the message queue with the server's connection handle, so at application level the handleUserDisconnected() is expected to be invoked with connHandleServerSide = pge_network::ServerConnHandle, for which the client is expected to remove all other players as well since they are/were also connecting to the same server and not available anymore from this client's perspective.

Parameters
sExtraDebugTextAn optional text that will be sent to the other side and will be logged to help debugging.

Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.

◆ getAllowListedAppMessages()

virtual std::set< pge_network::MsgApp::TMsgId > & pge_network::PgeIServerClient::getAllowListedAppMessages ( )
pure virtual

◆ getAllowListedPgeMessages()

virtual std::set< pge_network::PgePktId > & pge_network::PgeIServerClient::getAllowListedPgeMessages ( )
pure virtual

◆ getInjectByteCount()

virtual uint32_t pge_network::PgeIServerClient::getInjectByteCount ( ) const
pure virtual

◆ getInjectMsgCount()

virtual const std::map< pge_network::MsgApp::TMsgId, uint32_t > & pge_network::PgeIServerClient::getInjectMsgCount ( ) const
pure virtual

◆ getInjectPacketCount()

virtual uint32_t pge_network::PgeIServerClient::getInjectPacketCount ( ) const
pure virtual

◆ getInjectPacketPerSecondCount()

virtual uint32_t pge_network::PgeIServerClient::getInjectPacketPerSecondCount ( ) const
pure virtual

◆ getMsgAppId2StringMap()

virtual std::map< pge_network::MsgApp::TMsgId, std::string > & pge_network::PgeIServerClient::getMsgAppId2StringMap ( )
pure virtual

◆ getPacketQueueSize()

virtual std::size_t pge_network::PgeIServerClient::getPacketQueueSize ( ) const
pure virtual

◆ getRxByteCount()

virtual uint32_t pge_network::PgeIServerClient::getRxByteCount ( ) const
pure virtual

◆ getRxMsgCount()

virtual const std::map< pge_network::MsgApp::TMsgId, uint32_t > & pge_network::PgeIServerClient::getRxMsgCount ( ) const
pure virtual

◆ getRxPacketCount()

virtual uint32_t pge_network::PgeIServerClient::getRxPacketCount ( ) const
pure virtual

◆ getRxPacketPerSecondCount()

virtual uint32_t pge_network::PgeIServerClient::getRxPacketPerSecondCount ( ) const
pure virtual

◆ getTxByteCount()

virtual uint32_t pge_network::PgeIServerClient::getTxByteCount ( ) const
pure virtual

◆ getTxMsgCount()

virtual const std::map< pge_network::MsgApp::TMsgId, uint32_t > & pge_network::PgeIServerClient::getTxMsgCount ( ) const
pure virtual

◆ getTxPacketCount()

virtual uint32_t pge_network::PgeIServerClient::getTxPacketCount ( ) const
pure virtual

◆ getTxPacketPerSecondCount()

virtual uint32_t pge_network::PgeIServerClient::getTxPacketPerSecondCount ( ) const
pure virtual

◆ initialize()

virtual bool pge_network::PgeIServerClient::initialize ( )
pure virtual

Initialize the network instance.

Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.

◆ isInitialized()

virtual bool pge_network::PgeIServerClient::isInitialized ( ) const
pure virtual

Gets the state of the network instance.

Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.

◆ pollConnectionStateChanges()

virtual void pge_network::PgeIServerClient::pollConnectionStateChanges ( )
pure virtual

◆ pollIncomingMessages()

virtual bool pge_network::PgeIServerClient::pollIncomingMessages ( )
pure virtual

Moves incoming packets from the underlying network layer to PGE network layer as PgePackets.

Returns
True on success, false on error.

Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.

◆ popFrontPacket()

virtual pge_network::PgePacket pge_network::PgeIServerClient::popFrontPacket ( )
pure virtual

◆ send()

virtual void pge_network::PgeIServerClient::send ( const pge_network::PgePacket & pkt,
const pge_network::PgeNetworkConnectionHandle & connHandle = pge_network::ServerConnHandle )
pure virtual

Sends the given packet to the network instance specified.

Parameters
pktThe packet to be sent.
connHandleThe addressed network instance, that can be either a server or client instance. The default parameter means the addressed instance is the server instance. If server is specified and current instance is the server, the packet will be injected to self instead of actually sending it to the lower network level.

Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.

◆ shutdown()

virtual bool pge_network::PgeIServerClient::shutdown ( )
pure virtual

This stops the network instance.

Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.

◆ Update()

virtual void pge_network::PgeIServerClient::Update ( )
pure virtual

◆ WriteList()

virtual void pge_network::PgeIServerClient::WriteList ( ) const
pure virtual

Writes statistics to console.

Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.


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