Sha256: 7b4d9f663b2ec80fababc2ce5acd9c1bec7306e1f6bc28e46b392fb03b139fc2

Contents?: true

Size: 703 Bytes

Versions: 12

Compression:

Stored size: 703 Bytes

Contents

##
# Created by DNSSD::Service#getaddrinfo

class DNSSD::Reply::AddrInfo < DNSSD::Reply

  ##
  # IP address of host

  attr_reader :address

  ##
  # Host name

  attr_reader :hostname

  ##
  # Port name

  attr_reader :port

  ##
  # Time to live see #expired?

  attr_reader :ttl

  ##
  # Creates a new AddrInfo, called internally by DNSSD::Service#getaddrinfo

  def initialize(service, flags, interface, hostname, sockaddr, ttl)
    super service, flags, interface

    @hostname = hostname
    @port, @address = Socket.unpack_sockaddr_in sockaddr

    @created = Time.now
    @ttl = ttl
  end

  ##
  # Has this AddrInfo passed its TTL?

  def expired?
    Time.now > @created + ttl
  end

end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
dnssd-3.0.2 lib/dnssd/reply/addr_info.rb
dnssd-3.0.1 lib/dnssd/reply/addr_info.rb
dnssd-3.0.0 lib/dnssd/reply/addr_info.rb
dnssd-2.0.1 lib/dnssd/reply/addr_info.rb
dnssd-2.0 lib/dnssd/reply/addr_info.rb
dnssd-1.4 lib/dnssd/reply/addr_info.rb
dnssd-1.3.4 lib/dnssd/reply/addr_info.rb
dnssd-1.3.3 lib/dnssd/reply/addr_info.rb
dnssd-1.3.2 lib/dnssd/reply/addr_info.rb
rackjour-0.1.8 vendor/gems/gems/dnssd-1.3.1/lib/dnssd/reply/addr_info.rb
dnssd-1.3.1 lib/dnssd/reply/addr_info.rb
dnssd-1.3 lib/dnssd/reply/addr_info.rb