Managing locations is not an easy task. Now I realize that I need the ’/.reply’ receiver to know from which “remote place” the answer comes from so that it can update the corresponding RootProxy.
Actually, the only reference to a remote location used in oscit is the IpEndpointName from oscpack. This is fine as long as:
In rubyk, an Url can be used to reach any kind of connected device, not only network (and osc) based targets. This means that point (1) is not satisfied. The other problem is that most users don’t have any dns setup running on their local network and thus can’t use hostnames. They will end up having to find each and every IP address and write in stone in their patch. Bad, bad, bad. Point (2): no good.
I’d like to write urls like this in a patch:
oscit://example.com:5424/foo/bar <--- far remote, using dns
example.com:5424/foo/bar <--- defaults to oscit protocol
foo/bar <--- relative url
oscit://"stage camera"/contrast <--- find host/port by service name, nice !
"stage camera"/contrast <--- same as above
http://"web server"/status <--- using http, resolving with zeroconf
The rules to parse such urls become quite obvious:
://"..."), it’s a service name to be resolved by zeroconfSOME.IP.ADDR.ESS:port but we should not store this value in a patch.From all the ideas shown above we see that an Url class should provide the following elements:
In C++, this gives:
class Url
{
...
private:
Location location_;
std::string path_;
};
class Location
{
...
private:
std::string protocol_;
// hostname or service name
std::string name_;
// true if using hostname instead of service type
bool reference_by_hostname_;
unsigned long ip_;
uint port_;
};
The ‘location’ part of the Url contains the target location (when the url is going out) or the source location (when the url is coming in).
Storing locations on every url can be a waste if we need to do so very often so it could be better to just keep a pointer to a list of “known hosts” instead. This is left as an exercise ;-).
Funding from the Swiss Federal Office of Culture to write the graphical frontend to rubyk !
General ideas for the design of rubyk.
comments