lib/ruby_skynet/connection.rb in ruby_skynet-0.4.0.pre vs lib/ruby_skynet/connection.rb in ruby_skynet-0.4.0.pre2

- old
+ new

@@ -93,11 +93,11 @@ # Send blank ClientHandshake client_handshake = { 'clientid' => client_id } @logger.debug "Sending Client Handshake" @logger.trace 'Client Handshake', client_handshake - socket.write(BSON.serialize(client_handshake)) + socket.write(BSON.serialize(client_handshake).to_s) end # To prevent strange issues if user incorrectly supplies server names params.delete(:servers) params[:server] = server @@ -133,16 +133,16 @@ 'seq' => socket.user_data[:seq] } @logger.debug "Sending Header" @logger.trace 'Header', header - socket.write(BSON.serialize(header)) + socket.write(BSON.serialize(header).to_s) # The parameters are placed in the request object in BSON serialized form request = { 'clientid' => socket.user_data[:client_id], - 'in' => BSON.serialize(parameters).to_s, + 'in' => BSON::Binary.new(BSON.serialize(parameters).to_s), 'method' => method_name.to_s, 'requestinfo' => { 'requestid' => request_id, # Increment retry count to indicate that the request may have been tried previously 'retrycount' => retry_count, @@ -154,10 +154,10 @@ } @logger.debug "Sending Request" @logger.trace 'Request', request @logger.trace 'Parameters:', parameters - socket.write(BSON.serialize(request)) + socket.write(BSON.serialize(request).to_s) # Since Send does not affect state on the server we can also retry reads if idempotent @logger.debug "Reading header from server" header = Common.read_bson_document(socket)