diff --git a/lib/mysqlplus.rb b/lib/mysqlplus.rb index 88b0e06..76bad4c 100644 --- a/lib/mysqlplus.rb +++ b/lib/mysqlplus.rb @@ -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