ReplicaNet and RNLobby
1
|
#include <XPURL.h>
Public Member Functions | |
XPURL () | |
virtual | ~XPURL () |
void | BeginEnumerateTransports (void) |
Transport * | EnumerateTransports (void) |
std::string | ParseURLs (const std::string urls) |
void | Poll (void) |
void | SetManualPoll (void) |
void | SetAutomaticPoll (void) |
Static Public Member Functions | |
static void | RegisterTransport (Transport &transport) |
static void | RegisterDefaultTransports (void) |
static Transport * | FindTransport (const std::string url) |
static bool | FreeTransport (Transport *transport) |
static void | InitialiseNetwork (const bool hardware=false) |
static void | ShutdownNetwork (const bool hardware=false) |
static DebugHandler * | RegisterDebugHandler (DebugHandler *debugHandler=0) |
static DebugHandler * | GetDebugHandler (void) |
XPURL decodes and encodes URLs and acts as a common method for interfacing various networking protocols.
void BeginEnumerateTransports | ( | void | ) |
Starts enumerating the current number of Transport types
Transport* EnumerateTransports | ( | void | ) |
Enumerates the Transport list, BeginEnumerateTransports() must be called before this function Call this function repeatedly in a loop to enumerate through the list
|
static |
|
static |
Frees any resources for a Transport* returned by FindTransport()->Allocate();
|
static |
Returns the debug handler set by RegisterDebugHandler() or null.
|
static |
Causes the network layer to start. This can include all system level hardware on the target platform.
hardware | Set this to be true to initialise all network hardware. The default is false. It is not necessary to manually call this since the network will start automatically when the first network related function is used. |
std::string ParseURLs | ( | const std::string | urls | ) |
Parses a URL and after each iteration returns a tokenised URL. The first time this function is called pass in the whole URL and on subsequent calls pass in ""
void Poll | ( | void | ) |
This polls XPURL. Normally an application will yield enough time during threads for XPURL to function. Sometimes an application that uses a lot of 3D graphics can lock out other threads for quite some time. In these cases you may call XPURL::Poll() to yield some time to XPURL to perform housekeeping. If a reliable UDP transport is being used this function will also poll the reliable UDP manager.
Single threaded considerations:
When using the single threaded libraries this method should be called regularly. Unless XPSession::Poll() or ReplicaNet::Poll() is called in which case the default action is that this Poll() method is called.
|
static |
This registers an extensible debug handler for use by XPURL, XPSession, ReplicaNet and the Visual Debugger. A PlatformHeap::ForceFree() will delete the active currently registered DebugHandler class. The application can use RegisterDebugHandler() without a parameter to unregister the DebugHandler and avoid the handler being automatically freed by PlatformHeap::ForceFree().
debugHandler | A pointer to an instance of the debug handler class. The default value is null which disables the debugger output. |
|
static |
This static member function registers all of the default transports such as reliable UDP.
|
static |
void SetAutomaticPoll | ( | void | ) |
Sets the automatic Poll() method for this class and the reliable UDP manager.
In multi-threading libraries this restarts the automatic polling thread so that an application does not need the call Poll()
In single-threading libraries this method has no effect and does not start a thread.
The default multi-threading library behaviour is to enable multi-threading automatic polls,
The default single-threading library behaviour is to use manual polls,
void SetManualPoll | ( | void | ) |
Sets the manual Poll() method for this class and the reliable UDP manager.
For multi-threaded libraries this turns off the automatic polling method.
This allows an application to time exactly when polls are done.
The application must call Poll() on a regular basis. A good place is just before or after the frame update is done.
|
static |
Forces the network layer to shutdown if it is started. This can include all system level hardware on the target platform. This should only be used after users of XPURL classes, such as XPSession and ReplicaNet, have been freed. This does not free all internal allocated memory blocks, an example would be for registered factory classes. To force all internal allocated memory to be released RNReplicaNet::PlatformHeap::ForceFree() should be called. A PlatformHeap::ForceFree() will call ShutdownNetwork(true).
hardware | Set this to be true to shutdown all network hardware. The default is false. |