View | Details | Raw Unified | Return to bug 43653
Collapse All | Expand All

(-)NioBlockingSelector.java (-3 / +5 lines)
Lines 47-55 Link Here
47
        boolean timedout = false;
47
        boolean timedout = false;
48
        int keycount = 1; //assume we can write
48
        int keycount = 1; //assume we can write
49
        long time = System.currentTimeMillis(); //start the timeout timer
49
        long time = System.currentTimeMillis(); //start the timeout timer
50
        if (socket.getBufHandler().getWriteBuffer() != buf) {
50
        if (socket.getBufHandler().getWriteBuffer() != buf && buf.hasRemaining()) {
51
            socket.getBufHandler().getWriteBuffer().put(buf);
51
            ByteBuffer writeBuf = socket.getBufHandler().getWriteBuffer();
52
            buf = socket.getBufHandler().getWriteBuffer();
52
            writeBuf.put(buf);
53
            writeBuf.flip();
54
            buf = writeBuf;
53
        }
55
        }
54
        try {
56
        try {
55
            while ( (!timedout) && buf.hasRemaining()) {
57
            while ( (!timedout) && buf.hasRemaining()) {
(-)NioSelectorPool.java (-3 / +5 lines)
Lines 139-147 Link Here
139
        boolean timedout = false;
139
        boolean timedout = false;
140
        int keycount = 1; //assume we can write
140
        int keycount = 1; //assume we can write
141
        long time = System.currentTimeMillis(); //start the timeout timer
141
        long time = System.currentTimeMillis(); //start the timeout timer
142
        if ( socket.getBufHandler().getWriteBuffer()!= buf ) {
142
        if ( socket.getBufHandler().getWriteBuffer()!= buf && buf.hasRemaining()) {
143
            socket.getBufHandler().getWriteBuffer().put(buf);
143
            ByteBuffer writeBuf = socket.getBufHandler().getWriteBuffer();
144
            buf = socket.getBufHandler().getWriteBuffer();
144
            writeBuf.put(buf);
145
            writeBuf.flip();
146
            buf = writeBuf;
145
        }
147
        }
146
        try {
148
        try {
147
            while ( (!timedout) && buf.hasRemaining() ) {
149
            while ( (!timedout) && buf.hasRemaining() ) {

Return to bug 43653