* @see java.lang.Runnable#run()
*/
public void run() {
while (keepRunning) {
// get a link list of all queued objects
LinkObject entry = queue.remove();
if (entry != null) {
do {
int messagesize = 0;
try {
byte[] data = (byte[]) entry.data();
messagesize = data.length;
sender.pushMessage((String) entry.getKey(), data);
outQueueCounter++;
} catch (Exception x) {
log.warn(sm.getString(
"AsyncSocketSender.send.error", entry
.getKey()),x);
} finally {
reduceQueuedCounter(messagesize);
}
entry = entry.next();
} while (entry != null);
} else {
log.error(sm.getString("AsyncSocketSender.queue.empty",sender.getAddress(), new Integer(sender.getPort())));
}
}