Extended maintenance of Ruby versions 1.8.7 and 1.9.2 will end on July 31, 2014. Read more

In Files

  • resolv-replace.rb

Class/Module Index [+]

Quicksearch

UDPSocket

Public Instance Methods

bind(host, port) click to toggle source
 
               # File resolv-replace.rb, line 25
def bind(host, port)
  host = IPSocket.getaddress(host) if host != ""
  original_resolv_bind(host, port)
end
            
Also aliased as: original_resolv_bind
connect(host, port) click to toggle source
 
               # File resolv-replace.rb, line 31
def connect(host, port)
  original_resolv_connect(IPSocket.getaddress(host), port)
end
            
Also aliased as: original_resolv_connect
original_resolv_bind(host, port) click to toggle source
Alias for: bind
original_resolv_connect(host, port) click to toggle source
Alias for: connect
original_resolv_send(mesg, flags, *rest) click to toggle source
Alias for: send
send(mesg, flags, *rest) click to toggle source
 
               # File resolv-replace.rb, line 36
def send(mesg, flags, *rest)
  if rest.length == 2
    host, port = rest
    begin
      addrs = Resolv.getaddresses(host)
    rescue Resolv::ResolvError
      raise SocketError, "Hostname not known: #{host}"
    end
    err = nil
    addrs[0...-1].each {|addr|
      begin
        return original_resolv_send(mesg, flags, addr, port)
      rescue SystemCallError
      end
    }
    original_resolv_send(mesg, flags, addrs[-1], port)
  else
    original_resolv_send(mesg, flags, *rest)
  end
end
            
Also aliased as: original_resolv_send

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus