def receive(requestid = nil)
reply = nil
begin
reply = @connection.receive
reply.type = :reply
reply.expected_msgid = requestid
reply.decode!
reply.payload[:senderid] = Digest::MD5.hexdigest(reply.payload[:senderid]) if ENV.include?("MCOLLECTIVE_ANON")
raise(MsgDoesNotMatchRequestID, "Message reqid #{requestid} does not match our reqid #{reply.requestid}") unless reply.requestid == requestid
rescue SecurityValidationFailed => e
Log.warn("Ignoring a message that did not pass security validations")
retry
rescue MsgDoesNotMatchRequestID => e
Log.debug("Ignoring a message for some other client")
retry
end
reply
end