The ConnectionManager handles all messages that have to be sent in one queue. Every time the thread wakes up it tries to send all the messages. If there are several messages for the same destination the status of the connection is checked for each message.
Maybe the messages should be organized by destination so the checks have only to be done once for each destination.