mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05: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
1 changed files with 5 additions and 1 deletions
|
@ -847,7 +847,11 @@ module DRb
|
||||||
def self.getservername
|
def self.getservername
|
||||||
host = Socket::gethostname
|
host = Socket::gethostname
|
||||||
begin
|
begin
|
||||||
Socket::gethostbyname(host)[0]
|
Socket::getaddrinfo(host, nil,
|
||||||
|
Socket::AF_UNSPEC,
|
||||||
|
Socket::SOCK_STREAM,
|
||||||
|
0,
|
||||||
|
Socket::AI_PASSIVE)[0][3]
|
||||||
rescue
|
rescue
|
||||||
'localhost'
|
'localhost'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue