зеркало из https://github.com/github/ruby.git
Get rid of sporadic WSAEACCES on Windows [ruby-dev:42661]
This commit is contained in:
Родитель
dfe21ef7a1
Коммит
c711093559
|
@ -163,7 +163,12 @@ class TestSocket < Test::Unit::TestCase
|
|||
def random_port
|
||||
# IANA suggests dynamic port for 49152 to 65535
|
||||
# http://www.iana.org/assignments/port-numbers
|
||||
49152 + rand(65535-49152+1)
|
||||
case RUBY_PLATFORM
|
||||
when /mingw|mswin/
|
||||
rand(50000..65535)
|
||||
else
|
||||
rand(49152..65535)
|
||||
end
|
||||
end
|
||||
|
||||
def errors_addrinuse
|
||||
|
|
Загрузка…
Ссылка в новой задаче