Package java.nio.channels

Examples of java.nio.channels.SelectionKey.interestOps()


                                att.setCometNotify(false);
                            }
                            interestOps = (interestOps & (~OP_CALLBACK));//remove the callback flag
                            att.access();//to prevent timeout
                            //we are registering the key to start with, reset the fairness counter.
                            int ops = key.interestOps() | interestOps;
                            att.interestOps(ops);
                            key.interestOps(ops);
                            att.setCometOps(ops);
                        } else {
                            cancel = true;
View Full Code Here


                            interestOps = (interestOps & (~OP_CALLBACK));//remove the callback flag
                            att.access();//to prevent timeout
                            //we are registering the key to start with, reset the fairness counter.
                            int ops = key.interestOps() | interestOps;
                            att.interestOps(ops);
                            key.interestOps(ops);
                            att.setCometOps(ops);
                        } else {
                            cancel = true;
                        }
                    } else {
View Full Code Here

                        //only timeout sockets that we are waiting for a read from - or write (send file)
                        long delta = now - ka.getLastAccess();
                        long timeout = (ka.getTimeout()==-1)?((long) socketProperties.getSoTimeout()):(ka.getTimeout());
                        boolean isTimedout = delta > timeout;
                        if ( close ) {
                            key.interestOps(0);
                            ka.interestOps(0); //avoid duplicate stop calls
                            processKey(key,ka);
                        } else if (isTimedout) {
                            key.interestOps(0);
                            ka.interestOps(0); //avoid duplicate timeout calls
View Full Code Here

                        if ( close ) {
                            key.interestOps(0);
                            ka.interestOps(0); //avoid duplicate stop calls
                            processKey(key,ka);
                        } else if (isTimedout) {
                            key.interestOps(0);
                            ka.interestOps(0); //avoid duplicate timeout calls
                            cancelledKey(key, SocketStatus.TIMEOUT,true);
                        } else {
                            long nextTime = now+(timeout-delta);
                            nextExpiration = (nextTime < nextExpiration)?nextTime:nextExpiration;
View Full Code Here

            return;
        }
        SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector());
        if (read) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_READ);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
        if (write) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_WRITE);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
View Full Code Here

            return;
        }
        SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector());
        if (read) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_READ);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
        if (write) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_WRITE);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
View Full Code Here

            attach.interestOps(attach.interestOps() | SelectionKey.OP_READ);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
        if (write) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_WRITE);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
    }


    @Override
View Full Code Here

            attach.interestOps(attach.interestOps() | SelectionKey.OP_READ);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
        if (write) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_WRITE);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
    }


    @Override
View Full Code Here

            return;
        }
        SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector());
        if (read) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_READ);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
        if (write) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_WRITE);
            key.interestOps(key.interestOps() | SelectionKey.OP_WRITE);
        }
View Full Code Here

            return;
        }
        SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector());
        if (read) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_READ);
            key.interestOps(key.interestOps() | SelectionKey.OP_READ);
        }
        if (write) {
            attach.interestOps(attach.interestOps() | SelectionKey.OP_WRITE);
            key.interestOps(key.interestOps() | SelectionKey.OP_WRITE);
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.