Created
August 13, 2014 16:37
-
-
Save benweint/cad9ca369735d1c23c78 to your computer and use it in GitHub Desktop.
getaddrinfo and TCPSocket.new
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'socket' | |
require 'resolv' | |
require 'resolv-replace' | |
puts "Run this to trace getaddrinfo calls:" | |
puts "sudo dtrace -p #{$$} -n 'pid$target::getaddrinfo:entry { ustack(); }'" | |
loop do | |
puts "Opening!" | |
s = TCPSocket.open("google.com", 80) | |
s.close | |
sleep 5 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment