diff options
Diffstat (limited to 'lib/drb/drb.rb')
-rw-r--r-- | lib/drb/drb.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/drb/drb.rb b/lib/drb/drb.rb index 6a4e6021d..a2c11f980 100644 --- a/lib/drb/drb.rb +++ b/lib/drb/drb.rb @@ -842,15 +842,10 @@ module DRb Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE) - family = infos.collect { |af, *_| af }.uniq - case family - when ['AF_INET'] - return TCPServer.open('0.0.0.0', port) - when ['AF_INET6'] - return TCPServer.open('::', port) - else - return TCPServer.open(port) - end + families = Hash[*infos.collect { |af, *_| af }.uniq.zip([]).flatten] + return TCPServer.open('0.0.0.0', port) if families.has_key?('AF_INET') + return TCPServer.open('::', port) if families.has_key?('AF_INET6') + return TCPServer.open(port) end # Open a server listening for connections at +uri+ using |