Sirikata
|
A LocalServerIDMap implements the ServerIDMap interface for single-server setups: it only provides a single external server (frequently localhost and a port), and no internal addresses since there is no inter-space-server communication. More...
#include <LocalServerIDMap.hpp>
Public Member Functions | |
LocalServerIDMap (Context *ctx, const String &server_host, uint16 server_port) | |
virtual | ~LocalServerIDMap () |
virtual Address4 | lookupInternal (const ServerID &obj_id) |
virtual void | lookupInternal (const ServerID &sid, Address4LookupCallback cb) |
Lookup for internal addresses, i.e. | |
virtual Address4 | lookupExternal (const ServerID &obj_id) |
virtual void | lookupExternal (const ServerID &sid, Address4LookupCallback cb) |
Lookup for external addresses, i.e. | |
virtual void | lookupRandomExternal (Address4LookupCallback cb) |
Lookup a random external addres, e.g. | |
Private Attributes | |
ServerID | mID |
Address4 | mAddress |
A LocalServerIDMap implements the ServerIDMap interface for single-server setups: it only provides a single external server (frequently localhost and a port), and no internal addresses since there is no inter-space-server communication.
Only a single ServerID is provided.
Sirikata::LocalServerIDMap::LocalServerIDMap | ( | Context * | ctx, |
const String & | server_host, | ||
uint16 | server_port | ||
) |
virtual Sirikata::LocalServerIDMap::~LocalServerIDMap | ( | ) | [inline, virtual] |
Address4 Sirikata::LocalServerIDMap::lookupExternal | ( | const ServerID & | obj_id | ) | [virtual] |
References Sirikata::Logging::detailed, mAddress, mID, Sirikata::Address4::Null, and SILOG.
Referenced by lookupExternal().
void Sirikata::LocalServerIDMap::lookupExternal | ( | const ServerID & | sid, |
Address4LookupCallback | cb | ||
) | [virtual] |
Lookup for external addresses, i.e.
those used for object host to space server communication. Returns NullServerID or Address4::Null if the server can't be found.
Implements Sirikata::ServerIDMap.
References Sirikata::Context::ioService, lookupExternal(), Sirikata::ServerIDMap::mContext, and Sirikata::Network::IOService::post().
void Sirikata::LocalServerIDMap::lookupInternal | ( | const ServerID & | sid, |
Address4LookupCallback | cb | ||
) | [virtual] |
Lookup for internal addresses, i.e.
those used for space server to space server communication. Returns NullServerID or Address4::Null if the server can't be found.
Implements Sirikata::ServerIDMap.
References Sirikata::Context::ioService, lookupInternal(), Sirikata::ServerIDMap::mContext, and Sirikata::Network::IOService::post().
Referenced by lookupInternal().
Address4 Sirikata::LocalServerIDMap::lookupInternal | ( | const ServerID & | obj_id | ) | [virtual] |
References Sirikata::Logging::detailed, Sirikata::Address4::Null, and SILOG.
void Sirikata::LocalServerIDMap::lookupRandomExternal | ( | Address4LookupCallback | cb | ) | [virtual] |
Lookup a random external addres, e.g.
to find any node to bootstrap a connection to the space.
Implements Sirikata::ServerIDMap.
References Sirikata::Context::ioService, mAddress, Sirikata::ServerIDMap::mContext, mID, and Sirikata::Network::IOService::post().
Address4 Sirikata::LocalServerIDMap::mAddress [private] |
Referenced by lookupExternal(), and lookupRandomExternal().
ServerID Sirikata::LocalServerIDMap::mID [private] |
Referenced by lookupExternal(), and lookupRandomExternal().