class DNSSD::Reply::Browse

Returned by DNSSD::Service#browse

Attributes

domain[R]

A domain for registration or browsing

name[R]

The service name

type[R]

The service type

Public Class Methods

new(service, flags, interface, name, type, domain) click to toggle source

Creates a new Browse, called internally by DNSSD::Service#browse

Calls superclass method DNSSD::Reply.new
# 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

Public Instance Methods

connect(family = Socket::AF_UNSPEC, addrinfo_flags = 0) click to toggle source

Resolves this service's target using DNSSD::Reply::Resolve#connect which connects, returning a TCP or UDP socket.

# File lib/dnssd/reply/browse.rb, line 34
def connect(family = Socket::AF_UNSPEC, addrinfo_flags = 0)
  value = nil

  DNSSD.resolve! self do |reply|
    value = reply
    break
  end

  value.connect family, addrinfo_flags
end