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

(-)a/java/org/apache/tomcat/util/net/NioEndpoint.java (-3 / +11 lines)
Lines 788-794 public class NioEndpoint extends AbstractEndpoint<NioChannel> { Link Here
788
        public void run() {
788
        public void run() {
789
            if ( interestOps == OP_REGISTER ) {
789
            if ( interestOps == OP_REGISTER ) {
790
                try {
790
                try {
791
                    socket.getIOChannel().register(socket.getPoller().getSelector(), SelectionKey.OP_READ, key);
791
                    SelectionKey sk = socket.getIOChannel().register(socket.getPoller().getSelector(), SelectionKey.OP_READ, key);
792
                    key.setKey(sk);
792
                } catch (Exception x) {
793
                } catch (Exception x) {
793
                    log.error("", x);
794
                    log.error("", x);
794
                }
795
                }
Lines 1364-1369 public class NioEndpoint extends AbstractEndpoint<NioChannel> { Link Here
1364
            cometNotify = false;
1365
            cometNotify = false;
1365
            interestOps = 0;
1366
            interestOps = 0;
1366
            this.poller = poller;
1367
            this.poller = poller;
1368
            this.key = null;
1367
            sendfileData = null;
1369
            sendfileData = null;
1368
            if (readLatch != null) {
1370
            if (readLatch != null) {
1369
                try {
1371
                try {
Lines 1393-1398 public class NioEndpoint extends AbstractEndpoint<NioChannel> { Link Here
1393
1395
1394
        public Poller getPoller() { return poller;}
1396
        public Poller getPoller() { return poller;}
1395
        public void setPoller(Poller poller){this.poller = poller;}
1397
        public void setPoller(Poller poller){this.poller = poller;}
1398
        public SelectionKey getKey() {
1399
            return key;
1400
        }
1401
        public void setKey(SelectionKey key) {
1402
            this.key = key;
1403
        }
1396
        public void setCometNotify(boolean notify) { this.cometNotify = notify; }
1404
        public void setCometNotify(boolean notify) { this.cometNotify = notify; }
1397
        public boolean getCometNotify() { return cometNotify; }
1405
        public boolean getCometNotify() { return cometNotify; }
1398
        public int interestOps() { return interestOps;}
1406
        public int interestOps() { return interestOps;}
Lines 1434-1439 public class NioEndpoint extends AbstractEndpoint<NioChannel> { Link Here
1434
        public long getWriteTimeout() {return this.writeTimeout;}
1442
        public long getWriteTimeout() {return this.writeTimeout;}
1435
1443
1436
        private Poller poller = null;
1444
        private Poller poller = null;
1445
        private SelectionKey key = null;
1437
        private int interestOps = 0;
1446
        private int interestOps = 0;
1438
        private boolean cometNotify = false;
1447
        private boolean cometNotify = false;
1439
        private CountDownLatch readLatch = null;
1448
        private CountDownLatch readLatch = null;
Lines 1507-1514 public class NioEndpoint extends AbstractEndpoint<NioChannel> { Link Here
1507
        @Override
1516
        @Override
1508
        public void run() {
1517
        public void run() {
1509
            NioChannel socket = ka.getSocket();
1518
            NioChannel socket = ka.getSocket();
1510
            SelectionKey key = socket.getIOChannel().keyFor(
1519
            SelectionKey key = ka.getKey();
1511
                    socket.getPoller().getSelector());
1512
1520
1513
            // Upgraded connections need to allow multiple threads to access the
1521
            // Upgraded connections need to allow multiple threads to access the
1514
            // connection at the same time to enable blocking IO to be used when
1522
            // connection at the same time to enable blocking IO to be used when

Return to bug 56518