Package java.nio.channels

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


            {
                entry.setException( e );
            }
            finally
            {
                key.cancel();
                if( !success )
                {
                    try
                    {
                        ch.close();
View Full Code Here


                {
                    ExceptionMonitor.getInstance().exceptionCaught( e );
                }
                finally
                {
                    key.cancel();
                }
            }
        }
    }
View Full Code Here

                            while(iter.hasNext())
                            {
                                SelectionKey k = (SelectionKey) iter.next();
                                if (k.isValid()&&k.interestOps()==0)
                                {
                                    k.cancel();
                                    cancelled++;
                                }
                            }
                            if (cancelled>0)
                                _jvmFix0++;
View Full Code Here

                        {
                            if (++_busyKeyCount>__BUSY_KEY && !(busy.channel() instanceof ServerSocketChannel))
                            {
                                final SelectChannelEndPoint endpoint = (SelectChannelEndPoint)busy.attachment();
                                Log.warn("Busy Key "+busy.channel()+" "+endpoint);
                                busy.cancel();
                                if (endpoint!=null)
                                {
                                    dispatch(new Runnable()
                                    {
                                        public void run()
View Full Code Here

        SelectionKey selectionKey = socketChannel.keyFor(selector);

        if(selectionKey != null) {
            try {
                selectionKey.attach(null);
                selectionKey.cancel();
            } catch(Exception e) {
                if(logger.isEnabledFor(Level.WARN))
                    logger.warn(e.getMessage(), e);
            }
        }
View Full Code Here

        NioWorker worker = channel.getWorker();
        if (worker != null) {
            Selector selector = worker.selector;
            SelectionKey key = channel.socket.keyFor(selector);
            if (key != null) {
                key.cancel();
            }
        }

        boolean connected = channel.isConnected();
        boolean bound = channel.isBound();
View Full Code Here

        NioWorker worker = channel.getWorker();
        if (worker != null) {
            Selector selector = worker.selector;
            SelectionKey key = channel.socket.keyFor(selector);
            if (key != null) {
                key.cancel();
            }
        }

        boolean connected = channel.isConnected();
        boolean bound = channel.isBound();
View Full Code Here

            {
                entry.setException(e);
            }
            finally
            {
                key.cancel();
                if (!success)
                {
                    try
                    {
                        ch.close();
View Full Code Here

                {
                    ExceptionMonitor.getInstance().exceptionCaught(e);
                }
                finally
                {
                    key.cancel();
                }
            }
        }
    }
View Full Code Here

        if (key == null) {
            LOG.error("Trying to modify the registration of a not registered channel");
            return;
        }
        key.cancel();
        key.attach(null);

        if (IS_DEBUG) {
            LOG.debug("unregistering : {} done !", listener);
        }
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.