Skip to content

how to get the port of a service? #109

@umlaeute

Description

@umlaeute

now that i've started digging into Servus, it turns out that you cannot discover the port of a service.

e.g. in avahi.h, the uint16_t field which denotes the service port is simply unused:

static void _resolveCBS(AvahiServiceResolver* resolver, AvahiIfIndex,
AvahiProtocol, AvahiResolverEvent event,
const char* name, const char*, const char*,
const char* host, const AvahiAddress*, uint16_t,
AvahiStringList* txt, AvahiLookupResultFlags flags,
void* servus)

now i'm not an expert when it comes to ZeroConf, but in my understanding the port information is crucial for service discovery (at least this is what i gather than you always must provide a port when announcing a service; also, i don't know how one would actually reach a service without knowing both the host-address and the port).

have i been misusing Zeroconf, or is this just a weird omittance?

I'd suggest using the servus_port key for this information (though i admit i wonder why Servus would reserve any key (e.g. servus_host) for private use for obligatory information (like host-address, host-port, service-name and service-type))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions