Class: DNSSD::Reply::Browse
- Inherits:
-
DNSSD::Reply
- Object
- DNSSD::Reply
- DNSSD::Reply::Browse
- Defined in:
- lib/dnssd/reply/browse.rb
Overview
Returned by DNSSD::Service#browse
Instance Attribute Summary collapse
-
#domain ⇒ Object
readonly
A domain for registration or browsing.
-
#name ⇒ Object
readonly
The service name.
-
#type ⇒ Object
readonly
The service type.
Attributes inherited from DNSSD::Reply
Instance Method Summary collapse
-
#connect(family = Socket::AF_UNSPEC, addrinfo_flags = 0) ⇒ Object
Resolves this service’s target using DNSSD::Reply::Resolve#connect which connects, returning a TCP or UDP socket.
-
#initialize(service, flags, interface, name, type, domain) ⇒ Browse
constructor
Creates a new Browse, called internally by DNSSD::Service#browse.
-
#inspect ⇒ Object
:nodoc:.
- #resolve ⇒ Object
Methods inherited from DNSSD::Reply
#fullname, #interface_name, #protocol, #service_name, #set_fullname, #set_names
Constructor Details
#initialize(service, flags, interface, name, type, domain) ⇒ Browse
Creates a new Browse, called internally by DNSSD::Service#browse
24 25 26 27 28 |
# File 'lib/dnssd/reply/browse.rb', line 24 def initialize(service, flags, interface, name, type, domain) super service, flags, interface set_names name, type, domain end |
Instance Attribute Details
#domain ⇒ Object (readonly)
A domain for registration or browsing
9 10 11 |
# File 'lib/dnssd/reply/browse.rb', line 9 def domain @domain end |
#name ⇒ Object (readonly)
The service name
14 15 16 |
# File 'lib/dnssd/reply/browse.rb', line 14 def name @name end |
#type ⇒ Object (readonly)
The service type
19 20 21 |
# File 'lib/dnssd/reply/browse.rb', line 19 def type @type end |
Instance Method Details
#connect(family = Socket::AF_UNSPEC, addrinfo_flags = 0) ⇒ Object
Resolves this service’s target using DNSSD::Reply::Resolve#connect which connects, returning a TCP or UDP socket.
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/dnssd/reply/browse.rb', line 34 def connect(family = Socket::AF_UNSPEC, addrinfo_flags = 0) value = nil DNSSD.resolve! name, type, domain do |reply| value = reply break end value.connect family, addrinfo_flags end |
#inspect ⇒ Object
:nodoc:
50 51 52 53 54 |
# File 'lib/dnssd/reply/browse.rb', line 50 def inspect # :nodoc: "#<%s:0x%x %p interface: %s flags: %p>" % [ self.class, object_id, fullname, interface_name, @flags ] end |