Bug #8039 » drb-sockopt-8039.patch
lib/drb/drb.rb | ||
---|---|---|
def set_sockopt(soc) # :nodoc:
|
||
soc.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
||
rescue IOError, Errno::ECONNRESET, Errno::EINVAL
|
||
# closed/shutdown socket, ignore error
|
||
end
|
||
end
|
||
test/drb/test_drb.rb | ||
---|---|---|
end
|
||
end
|
||
class TestDRbTCP < Test::Unit::TestCase
|
||
def test_set_sockopt
|
||
server = DRb::DRbServer.new('druby://:0')
|
||
host, port, = DRb::DRbTCPSocket.send(:parse_uri, server.uri)
|
||
socket = TCPSocket.open host, port
|
||
socket.shutdown
|
||
socket.close
|
||
client = DRb::DRbTCPSocket.new(server.uri, socket)
|
||
assert client
|
||
client.close
|
||
server.stop_service
|
||
server.thread.join
|
||
(server.thread.group.list - [Thread.current]).each(&:join)
|
||
end
|
||
end
|
||
end
|
- « Previous
- 1
- 2
- Next »