Module dnssd

This module is the main interface to the application.

Description

This module is the main interface to the application.

The enumerate, browse, resolve and register functions all return {ok, op_ref()} or {error, term()}. Results are then sent to the calling process in messages of the form result_message(). If the operation crashes a message of the form {dnssd, op_ref(), crash} will be sent.

The synchronous resolve wrapper resolve_sync returns {ok, resolve_sync_result()} or {error, term()}.

Operation are stopped by passing op_ref() to stop/1. Operations will also be stopped if the calling process exits.

Data Types

browse_result()

browse_result() = {browse, add | remove, {name(), type(), domain()}}

domain()

domain() = binary() | iolist()

domain_type()

domain_type() = reg | browse

enumerate_result()

enumerate_result() = {enumerate, add | remove, binary()}

hostname()

hostname() = binary() | iolist()

ip_port()

ip_port() = 0..65535

name()

name() = binary() | iolist()

op_ref()

abstract datatype: op_ref()

register_result()

register_result() = {register, add | remove, {name(), type(), domain()}}

resolve_result()

resolve_result() = {resolve, {hostname(), ip_port(), txt_strings()}}

resolve_sync_result()

resolve_sync_result() = {hostname(), ip_port(), txt_strings()}

result()

result() = enumerate_result() | browse_result() | resolve_result() | register_result()

result_message()

result_message() = {dnssd, op_ref(), result()}

txt_string()

txt_string() = {atom() | iolist(), atom(), iolist()} | iolist()

txt_strings()

txt_strings() = <<>> | <<_:8, _:_*8>> | [txt_string()]

type()

type() = binary() | iolist()

Function Index

browse/1Equivalent to browse(Type, <<>>).
browse/2Browse for services.
enumerate/1Enumerate browse or registration domains.
register/2Equivalent to register(Type, Port, <<>>).
register/3edoc doesn't pickup the alternative invocation which is: register(Type::iolist(), Port::integer(), Txt::list() | iolist()).
register/4Equivalent to register(Name, Type, Port, Txt, <<>>, <<>>).
register/6Register a service.
resolve/3Resolve a service instance.
resolve_sync/3Equivalent to resolve_sync(Name, Type, Domain, 5000).
resolve_sync/4Returns the first result from resolving a service instance and then cancels the operation.
results/1Retrieve the current results of an operation.
start/0Start the DNSSD application.
stop/0Stop the DNSSD application.
stop/1Stop a DNSSD operation.

Function Details

browse/1

browse(Type::type()) -> {ok, op_ref()} | {error, term()}

Equivalent to browse(Type, <<>>).

browse/2

browse(Type::type(), Domain::domain()) -> {ok, op_ref()} | {error, term()}

Browse for services. If domain is empty, browse all domains.

enumerate/1

enumerate(Type::domain_type()) -> {ok, op_ref()} | {error, term()}

Enumerate browse or registration domains

register/2

register(Type::type(), Port::ip_port()) -> {ok, op_ref()} | {error, term()}

Equivalent to register(Type, Port, <<>>).

register/3

register(Name::name(), Type::type(), Port::ip_port()) -> {ok, op_ref()} | {error, term()}

register(Name::type(), Type::ip_port(), Port::txt_strings()) -> {ok, op_ref()} | {error, term()}

Equivalent to register(Name, Type, Port, Txt).

edoc doesn't pickup the alternative invocation which is: register(Type::iolist(), Port::integer(), Txt::list() | iolist())

register/4

register(Name::name(), Type::type(), Port::ip_port(), Txt::txt_strings()) -> {ok, op_ref()} | {error, term()}

Equivalent to register(Name, Type, Port, Txt, <<>>, <<>>).

register/6

register(Name::name(), Type::type(), Port::ip_port(), Txt::txt_strings(), Host::hostname(), Domain::domain()) -> {ok, op_ref()} | {error, term()}

Register a service. If localhost is passed as Host the service will be registered only on the local machine.

resolve/3

resolve(Name::name(), Type::type(), Domain::domain()) -> {ok, op_ref()} | {error, term()}

Resolve a service instance.

resolve_sync/3

resolve_sync(Name::name(), Type::type(), Domain::domain()) -> {ok, resolve_sync_result()} | {error, term()}

Equivalent to resolve_sync(Name, Type, Domain, 5000).

resolve_sync/4

resolve_sync(Name::name(), Type::type(), Domain::domain(), Timeout::pos_integer()) -> {ok, resolve_sync_result()} | {error, term()}

Returns the first result from resolving a service instance and then cancels the operation. Times out after Timeout milliseconds.

results/1

results(Ref::op_ref()) -> {ok, [result()]} | {error, term()}

Retrieve the current results of an operation

start/0

start() -> ok | {error, term()}

Start the DNSSD application

stop/0

stop() -> ok | {error, term()}

Stop the DNSSD application

stop/1

stop(Ref::op_ref()) -> ok | {error, term()}

Stop a DNSSD operation


Generated by EDoc