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

Inherits:
UnconnectedUDP show all
Defined in:
lib/logstash/patches/resolv_9270.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from UnconnectedUDP

#close, #initialize, #lazy_initialize, #recv_reply

Methods inherited from Resolv::DNS::Requester

#close, #initialize, #request

Constructor Details

This class inherits a constructor from Resolv::DNS::Requester::UnconnectedUDP

Instance Method Details

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



889
890
891
892
893
894
895
896
897
# File 'lib/logstash/patches/resolv_9270.rb', line 889

def sender(msg, data, host, port=Port)
  lazy_initialize
  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



899
900
901
902
# File 'lib/logstash/patches/resolv_9270.rb', line 899

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