Commit fb26b191 authored by chiaming2000's avatar chiaming2000
Browse files

Java client: fix for issue #32 - asyncQueuedSize is not always respected

if exceeded max limit. 
parent 72321bd8
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -321,15 +321,12 @@ public class MessageHandler implements ClientMessageService, Runnable {
		Long seq = Long.valueOf(message.getCommand().getHeader()
				.getSequence());

        // synchronized (this) {
			while (this.ackmap.size() >= this.asyncQueuedSize && this.isRunning) {
		while (ackmap.size() >= asyncQueuedSize && (isClosed == false)) {
			this.wait();
            // }
		}

		this.ackmap.put(seq, context);
		
		// this.iohandler.write(message);
		this.doWrite(message);
	}