зеркало из https://github.com/github/ruby.git
Try interface indexes which can use for IPv6 multicast
a fix for r39896 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
c4d2d856b8
Коммит
7a8329737a
|
@ -580,7 +580,19 @@ class TestRingFinger < Test::Unit::TestCase
|
|||
|
||||
def setup
|
||||
@rf = Rinda::RingFinger.new
|
||||
@rf.multicast_interface = 1
|
||||
ifindex = nil
|
||||
10.times do |i|
|
||||
begin
|
||||
addrinfo = Addrinfo.udp('ff02::1', Rinda::Ring_PORT)
|
||||
soc = Socket.new(addrinfo.pfamily, addrinfo.socktype, addrinfo.protocol)
|
||||
soc.setsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_IF,
|
||||
[i].pack('I'))
|
||||
ifindex = i
|
||||
break
|
||||
rescue
|
||||
end
|
||||
end
|
||||
@rf.multicast_interface = ifindex
|
||||
end
|
||||
|
||||
def test_make_socket_unicast
|
||||
|
|
Загрузка…
Ссылка в новой задаче