class Net::LDAP::Connection

def queued_read(message_id)

Returns a Net::LDAP::PDU object or nil.

message ID.
with mismatched IDs gets queued for subsequent reads by the origin of that
the connected socket until a message matching the ID is read. Any messages
Internal: Reads messages by ID from a queue, falling back to reading from
def queued_read(message_id)
  if pdu = message_queue[message_id].shift
    return pdu
  end
  # read messages until we have a match for the given message_id
  while pdu = read
    return pdu if pdu.message_id == message_id
    message_queue[pdu.message_id].push pdu
    next
  end
  pdu
end