Abstract class for settings for endpoints. More...
Classes | |
struct | EnumeratedServerInfo_t |
Information presented to the callback on a server to add or remove from the application's internal lists. More... | |
struct | LocatedServer_t |
Description of a located server. More... | |
Public Types | |
enum | eServerEnumerationCommand { kServerAdd , kServerRemove , kServerClearList } |
Command code for enumeration callback. More... | |
typedef void(*) | EnumerationProc(void *pThis, eServerEnumerationCommand uCommand, const EnumeratedServerInfo_t *pServerInfo) |
Function prototype for server enumeration callback. | |
Public Member Functions | |
const Burger::StaticRTTI * | get_StaticRTTI (void) const noexcept override |
Get the description to the class. | |
virtual | ~NetworkModuleSettings () |
Default base destructor. | |
uint32_t | GetGameID (void) const |
eNetworkProtocol | GetType (void) const |
const NetAddr_t * | GetRemoteAddress (void) const |
const LocatedServer_t * | GetServerList (void) const |
uint_t | GetServerListSize (void) const |
const char * | GetURL (void) const |
eError | SetURL (const char *pURL) |
eError | SetURLByAddress (const NetAddr_t *pAddress) |
Set the address of the requested destination endpoint. | |
eSocketFlags | GetSocketFlags (void) const |
void | SetSocketFlags (eSocketFlags uSocketFlags) |
uint_t | GetPassiveMode (void) const |
void | SetPassiveMode (uint_t bPassiveMode) |
virtual eError | OpenEndpoint (NetworkEndpoint::CallbackProc pCallback, void *pContext, NetworkEndpoint **ppEndpoint, NetworkEndpoint::eOpenType uFlags)=0 |
virtual eError | OpenEndpointInstance (NetworkEndpointInstance::CallbackProc pCallback, void *pContext, NetworkEndpointInstance **ppEndpointInstance, NetworkEndpoint::eOpenType uFlags)=0 |
virtual eError | StartEnumeration (EnumerationProc pCallback, void *pData, uint_t bScanNetwork=1)=0 |
virtual eError | EndEnumeration (void)=0 |
virtual eError | LoadSettings (const LocatedServer_t *pServer)=0 |
virtual eError | NewEndpoint (NetworkEndpoint **ppEndpoint, NetworkEndpoint::CallbackProc pCallback, void *pContext, NetworkEndpoint::eOpenType uFlags)=0 |
eError | Poll (void) noexcept |
Yield CPU time for background tasks. | |
virtual eError | HandleEnumerationPackets (void)=0 |
void | UpdateLists (void) |
Update enumerated server lists. | |
Public Member Functions inherited from Burger::Base | |
const char * | get_class_name (void) const noexcept |
Get the name of the class. | |
virtual | ~Base () noexcept=default |
Destructor. | |
Public Attributes | |
NetworkModule * | m_pNetworkModule |
Parent NetworkModule. | |
uint32_t | m_uGameID |
ID of the game host. | |
eNetworkProtocol | m_uType |
Module type that this setting came from. | |
EnumerationProc | m_pCallback |
Enumeration callback function. | |
void * | m_pCallbackData |
Enumeration callback data. | |
LocatedServer_t * | m_pGameArray |
Array of located external servers. | |
String | m_URL |
URL of the desired address. | |
String | m_GameName |
Application supplied game name. | |
NetAddr_t | m_RemoteAddress |
Resolved address of the URL. | |
eSocketFlags | m_uSocketFlags |
Datagram/Stream flags. | |
uint_t | m_bPassiveMode |
Enable passive mode. | |
uint_t | m_bIsEnumerating |
Enumeration is in progress. | |
uint_t | m_bEnumerationIsActive |
Enumeration is active. | |
uint_t | m_uGameCount |
Number of games in the cache. | |
uint_t | m_uNewGameCount |
Number of games to add to the list. | |
char | m_TempBuffer [kBufferSize] |
Work buffer. | |
LocatedServer_t | m_NewGameEntries [kMaxGamesInPendingList] |
Buffer for enumerating games via interrupts. | |
Static Public Attributes | |
static const Burger::StaticRTTI | g_StaticRTTI |
static const uint_t | kMaxGameNameLen = 31 |
The longest allowed game name in bytes. | |
static const uint_t | kMaxGamesInPendingList = 10 |
Maximum number of PENDING servers to process in a single pass. | |
static const uint_t | kBufferSize = 1024 |
Maximum size of a server description packet. | |
static const uint_t | kEnumerationTimeout = 2000 |
Time in milliseconds before a server is dropped for lack of pings. | |
static const uint_t | kEnumerationPingTime = 500 |
Number of milliseconds to wait between pings. | |
Static Public Attributes inherited from Burger::Base | |
static const Burger::StaticRTTI | g_StaticRTTI |
The global description of the class. | |
Protected Member Functions | |
NetworkModuleSettings (NetworkModule *pNetworkModule, uint32_t uGameID, const char *pGameName) | |
Default base constructor. | |
Private Member Functions | |
NetworkModuleSettings (const NetworkModuleSettings &)=delete | |
NetworkModuleSettings & | operator= (const NetworkModuleSettings &)=delete |
NetworkModuleSettings (NetworkModuleSettings &&)=delete | |
NetworkModuleSettings & | operator= (NetworkModuleSettings &&)=delete |
Abstract class for settings for endpoints.
When a network protocol is selected, a setting class is created to allow modifications by the application for where the connection is to be directed at. Both passive (GET/POST requests) and active (Live games) are supported.
This class is not meant to be created directly, instead request an instance from NetworkModule which will redirect to the proper instantiator for the selected protocol / module
void( *) Burger::NetworkModuleSettings::EnumerationProc(void *pThis, eServerEnumerationCommand uCommand, const EnumeratedServerInfo_t *pServerInfo) |
Function prototype for server enumeration callback.
pThis | Pointer to application provided context pointer |
uCommand | Command code |
pServerInfo | Pointer to information about the server the command is referring to. |
Command code for enumeration callback.
When enumeration is active, when remote servers are found or lost a user supplied callback will be issued and this enumeration value contains the command the callback should follow to maintain its own list of servers.
Enumerator | |
---|---|
kServerAdd | Add a server to your list. |
kServerRemove | Remove a server from your list. |
kServerClearList | Clear out your list. |
|
privatedelete |
|
privatedelete |
|
protected |
Default base constructor.
This base class constructor will set up all the defaults which can be overridden by the derived classes.
pNetworkModule | Pointer to the parent NetworkModule |
uGameID | Unique Game ID for the game server being created |
pGameName | Name of the game server |
|
virtual |
Default base destructor.
|
pure virtual |
Implemented in Burger::NetworkModuleSettingsTCP.
|
overridevirtualnoexcept |
Get the description to the class.
This virtual function will pull the pointer to the StaticRTTI instance that has the name of the class. Due to it being virtual, it will be the name of the most derived class.
Reimplemented from Burger::Base.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
pure virtual |
Implemented in Burger::NetworkModuleSettingsTCP.
|
pure virtual |
Implemented in Burger::NetworkModuleSettingsTCP.
|
pure virtual |
Implemented in Burger::NetworkModuleSettingsTCP.
|
pure virtual |
Implemented in Burger::NetworkModuleSettingsTCP.
|
pure virtual |
Implemented in Burger::NetworkModuleSettingsTCP.
|
privatedelete |
|
privatedelete |
|
noexcept |
Yield CPU time for background tasks.
|
inline |
|
inline |
|
inline |
Burger::eError BURGER_API Burger::NetworkModuleSettings::SetURLByAddress | ( | const NetAddr_t * | pAddress | ) |
Set the address of the requested destination endpoint.
pAddress | Pointer to the address the endpoint will connect to. |
|
pure virtual |
Implemented in Burger::NetworkModuleSettingsTCP.
void BURGER_API Burger::NetworkModuleSettings::UpdateLists | ( | void | ) |
Update enumerated server lists.
This private function is called by NetworkModule code that's scanning the network for game servers. If any are found, the entries are stored in a buffer which is scanned by this function and the internal game list is adjusted to maintain this list
|
static |
|
static |
Maximum size of a server description packet.
|
static |
Number of milliseconds to wait between pings.
|
static |
Time in milliseconds before a server is dropped for lack of pings.
|
static |
The longest allowed game name in bytes.
|
static |
Maximum number of PENDING servers to process in a single pass.
uint_t Burger::NetworkModuleSettings::m_bEnumerationIsActive |
Enumeration is active.
uint_t Burger::NetworkModuleSettings::m_bIsEnumerating |
Enumeration is in progress.
uint_t Burger::NetworkModuleSettings::m_bPassiveMode |
Enable passive mode.
String Burger::NetworkModuleSettings::m_GameName |
Application supplied game name.
LocatedServer_t Burger::NetworkModuleSettings::m_NewGameEntries[kMaxGamesInPendingList] |
Buffer for enumerating games via interrupts.
EnumerationProc Burger::NetworkModuleSettings::m_pCallback |
Enumeration callback function.
void* Burger::NetworkModuleSettings::m_pCallbackData |
Enumeration callback data.
LocatedServer_t* Burger::NetworkModuleSettings::m_pGameArray |
Array of located external servers.
NetworkModule* Burger::NetworkModuleSettings::m_pNetworkModule |
Parent NetworkModule.
NetAddr_t Burger::NetworkModuleSettings::m_RemoteAddress |
Resolved address of the URL.
char Burger::NetworkModuleSettings::m_TempBuffer[kBufferSize] |
Work buffer.
uint_t Burger::NetworkModuleSettings::m_uGameCount |
Number of games in the cache.
uint32_t Burger::NetworkModuleSettings::m_uGameID |
ID of the game host.
uint_t Burger::NetworkModuleSettings::m_uNewGameCount |
Number of games to add to the list.
String Burger::NetworkModuleSettings::m_URL |
URL of the desired address.
eSocketFlags Burger::NetworkModuleSettings::m_uSocketFlags |
Datagram/Stream flags.
eNetworkProtocol Burger::NetworkModuleSettings::m_uType |
Module type that this setting came from.