#5 Using unqualified service names in the API

closed
nobody
None
5
2005-10-23
2004-02-08
No

The API of JmDNS always uses two parameters '(qualified) name'
and 'type' to identify a service instance.

i.e. to register a service with the unqualified name 'My Service'
and of type '_http._tcp.' one has to create a ServiceInfo object
using the following parameters:

new ServiceInfo( "_http._tcp.", "My Service._http._tcp.", ...);

The qualified name and the type are redundant to some extent.
This leads to confusion (well, at least this confuses me).

The API would be easier to understand, if it either used only one
parameter (the fully qualified name) or two non-redundant
parameters (the type and the unqualified name).

Since parsing a fully qualified name may not be possible, (i.e.
when the unqualified name contains dots '.'), I am in favor for
using the type and the unqualified name.

After implementation of this RFE, to register a service with the
unqualified name 'My Service' and of type '_http._tcp.' one would
create a ServiceInfo object using the following parameters:

new ServiceInfo( "_http._tcp.", "My Service", ...);

Note: The implementation of this RFE will affect all public methods
of JmDNS, which use 'type' and 'name' as parameters.

Discussion

  • Rick Blair
    Rick Blair
    2005-10-23

    • status: open --> closed