Flush after every socket write. Nil out @socket earlier during close. Bumped patch version number.

This commit is contained in:
Jim Menard 2009-02-05 09:53:10 -05:00
parent 5ccd85ebad
commit d5f9f024ed
2 changed files with 7 additions and 3 deletions

View File

@ -288,8 +288,11 @@ module XGen
# Close the connection to the database.
def close
@socket.close if @socket
@socket = nil
if @socket
s = @socket
@socket = nil
s.close
end
end
def connected?
@ -426,6 +429,7 @@ module XGen
connect_to_master if !connected? && @auto_reconnect
begin
@socket.print(message.buf.to_s)
@socket.flush
rescue => ex
close
raise ex

View File

@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'mongo'
s.version = '0.5.1'
s.version = '0.5.2'
s.platform = Gem::Platform::RUBY
s.summary = 'Simple pure-Ruby driver for the 10gen Mongo DB'
s.description = 'A pure-Ruby driver for the 10gen Mongo DB. For more information about Mongo, see http://www.mongodb.org.'