Class: DNSSD::Service::Register

Inherits:
DNSSD::Service show all
Defined in:
lib/dnssd/service.rb,
ext/dnssd/service.c

Constant Summary

Constants inherited from DNSSD::Service

DaemonVersion, IPv4, IPv6, MAX_DOMAIN_NAME, MAX_SERVICE_NAME, TCP, UDP

Instance Method Summary collapse

Methods inherited from DNSSD::Service

#async_each, browse, check_domain, #each, enumerate_domains, fullname, get_property, getaddrinfo, #push, query_record, register, resolve, #started?, #stop

Constructor Details

#initializeRegister

Returns a new instance of Register.



31
32
33
34
# File 'lib/dnssd/service.rb', line 31

def initialize
  super
  @records = []
end

Instance Method Details

#add_record(type, data, ttl = 0, flags = 0) ⇒ Object

Adds an extra DNS record of type containing data. ttl is in seconds, use 0 for the default value. flags are currently ignored.

Must be called on a service only after #register.

Returns the added DNSSD::Record



44
45
46
# File 'lib/dnssd/service.rb', line 44

def add_record type, data, ttl = 0, flags = 0
  @records << _add_record(flags.to_i, type, data, ttl)
end