store references to IO objects to prevent "Bad file descriptor - (Errno::EBADF)"

This commit is contained in:
Aman Gupta 2008-08-27 16:11:58 -07:00
parent 9c6888c044
commit de6a01f297

View File

@ -3,7 +3,7 @@ require 'mysql'
class Mysql
def async_query(sql)
send_query(sql)
select([IO.new(socket)],nil,nil,nil)
select [ (@sockets ||= {})[socket] ||= IO.new(socket) ], nil, nil, nil
get_result
end
end