Class: Resolv::DNS::Requester::MDNSOneShot

Inherits:
UnconnectedUDP
  • Object
show all
Defined in:
lib/shuttlecraft/resolv.rb

Instance Method Summary collapse

Instance Method Details

#sender(msg, data, host, port = Port) ⇒ Object



58
59
60
61
62
63
64
65
# File 'lib/shuttlecraft/resolv.rb', line 58

def sender(msg, data, host, port=Port)
  id = DNS.allocate_request_id(host, port)
  request = msg.encode
  request[0,2] = [id].pack('n')
  sock = @socks_hash[host.index(':') ? "::" : "0.0.0.0"]
  return @senders[id] =
    UnconnectedUDP::Sender.new(request, data, sock, host, port)
end

#sender_for(addr, msg) ⇒ Object



67
68
69
# File 'lib/shuttlecraft/resolv.rb', line 67

def sender_for(addr, msg)
  @senders[msg.id]
end