mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
If host of URI is omitted, make it with IP address.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2948dc26bd
commit
3381ffee1d
@ -847,7 +847,11 @@ module DRb
|
||||
def self.getservername
|
||||
host = Socket::gethostname
|
||||
begin
|
||||
Socket::gethostbyname(host)[0]
|
||||
Socket::getaddrinfo(host, nil,
|
||||
Socket::AF_UNSPEC,
|
||||
Socket::SOCK_STREAM,
|
||||
0,
|
||||
Socket::AI_PASSIVE)[0][3]
|
||||
rescue
|
||||
'localhost'
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user