原谅我先把源码放上来,再细品。。。。
/*
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
* *
*/
package java.nio.channels;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import java.io.IOException;
/**
* A token representing the registration of a {@link SelectableChannel} with a
* {@link Selector}.
*
* <p> A selection key is created each time a channel is registered with a
* selector. A key remains valid until it is <i>cancelled</i> by invoking its
* {@link #cancel cancel} method, by closing its channel, or by closing its
* selector. Cancelling a key does not immediately remove it from its
* selector; it is instead added to the
本文主要探讨了Netty中的SelectionKey,通过分析源码,揭示了其在非阻塞I/O中的关键作用,帮助读者理解如何在Netty应用中有效利用SelectionKey进行高效的网络通信。
订阅专栏 解锁全文

518

被折叠的 条评论
为什么被折叠?



