Bug #13856 » segv-test-socket-test_socket.rb.patch
test/socket/test_socket.rb | ||
---|---|---|
server = TCPServer.new("localhost", 0)
|
||
serv_thread = Thread.new {server.accept}
|
||
begin sleep(0.1) end until serv_thread.stop?
|
||
sock = TCPSocket.new("localhost", server.addr[1])
|
||
client_thread = Thread.new do
|
||
sock.readline
|
||
end
|
||
sock = TCPSocket.new("localhost", server.addr[1]) ; sock.autoclose = false
|
||
client_thread = Thread.new {sock.readline}
|
||
begin sleep(0.1) end until client_thread.stop?
|
||
Timeout.timeout(1) do
|
||
sock.close
|