Skip to content

Commit

Permalink
DRb connects via hostname if IP can't be resolved
Browse files Browse the repository at this point in the history
Closes gh-16
Closes gh-12
  • Loading branch information
sandro committed Nov 1, 2010
1 parent 0a01cf7 commit 217c2c4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/specjour/socket_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module SocketHelper

def ip_from_hostname(hostname)
Socket.getaddrinfo(hostname, nil, Socket::AF_INET, Socket::SOCK_STREAM).first.fetch(3)
rescue SocketError
hostname
end

def hostname
Expand Down

0 comments on commit 217c2c4

Please sign in to comment.