interreality.org [VOS]
[Home] [About]
[Screenshots]
[Download]
[News]
[Community]
[Documentation] [Manual]
[Bugs & Requests] [Wiki]

VOS::Services Class Reference
[libmetaobject_services]

#include <vos/metaobjects/misc/services.hh>

Inheritance diagram for VOS::Services:

VOS::MetaObject VOS::Vobject VOS::Dispatchable VUtil::RefCounted List of all members.

Detailed Description

This metaobject provides a list of services it finds on the local network via Multicast DNS Service Discovery ("Rendezvous") or from remote Services objects.

(See http://www.dns-sd.org for more information about MDNS service discovery.) It also provides a method to advertise a service. Use a ChildChangeListener to find services discovered by a Services object.

Services are represented by Hypercard objects. The hypercards in the list will have, as co-types, a list of the types of the objects that the hypercard links to prefixed with "linktype=". For example, a hypercard in a services directory points to a A3DL virtual world. The hypercard itself will have as types both "misc:hypercard" and "linktype=a3dl:world". This enables searches on a particular type string without needing to contact the remote object.

Note:
Normally any Services object can be queried by other, remote Services objects. Set a local-only access control policy to prevent this.
Todo:
a few changes to make things a bit more efficient (there are some redundant hostname lookups, etc)

it will use all network interfaces currently, you may want to control that or you'll get duplicate messages for the same object

Definition at line 82 of file services.hh.

Public Member Functions

Static Public Member Functions


Constructor & Destructor Documentation

VOS::Services::Services ( VobjectBase superobject  ) 

For internal use only.

VOS::Services::~Services (  ) 

For internal use only.


Member Function Documentation

void VOS::Services::addService ( const std::string &  url,
const std::string &  name = "",
const std::string &  description = "" 
)

Create a service hypercard and add it to this service list.

void VOS::Services::addService ( Vobject obj,
const std::string &  name = "",
const std::string &  description = "" 
)

Create a service hypercard and add it to this service list.

static void VOS::Services::advertiseService ( const std::string &  servicetype,
const std::string &  netproto,
const std::string &  name,
const int  port,
std::vector< std::string >  txt 
) [static]

Advertise any (including non-VOS) TCP service on the local network.

This is publically provided as a convenience in case you have non-VOS services as well.

Parameters:
servicetype Name of the service; e.g. "http"
netproto "tcp" or "udp".
name Title for this service instance
port Port of this service (on this host)
txt Extra text tokens to include (often as "key=value")

static void VOS::Services::advertiseService ( Vobject obj,
const std::string &  title = "",
const std::string &  description = "" 
) [static]

Advertise a service on the local network.

If no name is given, it is taken from the "misc:title" property of obj if obj has one, else from its site name. If no description is given, it is taken from the "misc:description" property of obj.

static void VOS::Services::disableRendezvousThreads ( bool  m = false  )  [static]

Normally, Rendezvous actions run in new threads, but this is not always neccesary.

Call this function to disable new threads. The setting applies to all instances of Services (it's static).

void VOS::Services::findLocalServices ( const std::string &  type = ""  ) 

Begin query on the local network for services.

When a service is found a Hypercard object will be added to this object as a child.

Parameters:
type VOS type to search for. If this is the empty string, all VOS services will be queried.

const std::string VOS::Services::getVOSType (  )  [virtual]

Return type string ("misc:services").

Reimplemented from VOS::MetaObject.

void VOS::Services::includeServicelist ( const std::string &  url,
const std::string &  type = "" 
)

void VOS::Services::includeServicelist ( Services servicelist,
const std::string &  type = "" 
)

Begin reflecting the contents of another Services list in this one.

Exceptions:
VOS::NoSuchObjectError if 'url' cannot be resolved to a Services object.

static MetaObject* VOS::Services::new_Services ( VobjectBase s,
const std::string &  t 
) [static]

For internal use only.


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