Flush after every socket write. Nil out @socket earlier during close. Bumped patch version number.
This commit is contained in:
parent
5ccd85ebad
commit
d5f9f024ed
|
@ -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
|
||||
|
|
|
@ -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.'
|
||||
|
|
Loading…
Reference in New Issue