RUBY-142 (Frédéric De Jaeger) fix for broken socket send
This commit is contained in:
parent
bdce8db3e6
commit
82ffae676b
|
@ -696,7 +696,10 @@ module Mongo
|
|||
# Requires a packed message and an available socket,
|
||||
def send_message_on_socket(packed_message, socket)
|
||||
begin
|
||||
socket.send(packed_message, 0)
|
||||
while packed_message.size > 0
|
||||
byte_sent = socket.send(packed_message, 0)
|
||||
packed_message.slice!(0, byte_sent)
|
||||
end
|
||||
rescue => ex
|
||||
close
|
||||
raise ConnectionFailure, "Operation failed with the following exception: #{ex}"
|
||||
|
|
Loading…
Reference in New Issue