软件包 | 描述 |
---|---|
java.nio.channels |
定义了渠道,它代表的是能够执行I/O操作的实体连接,如文件和套接字;定义选择器,多路复用,非阻塞I/O操作。
|
java.nio.channels.spi |
为
java.nio.channels 包服务提供商类。
|
Modifier and Type | Method and Description |
---|---|
abstract SelectionKey |
SelectionKey.interestOps(int ops)
将此键的兴趣集设置为给定值。
|
abstract SelectionKey |
SelectableChannel.keyFor(Selector sel)
用给定选择器检索表示信道的注册的键。
|
SelectionKey |
SelectableChannel.register(Selector sel, int ops)
用所给的选择器来注册这个通道,返回一个选择键。
|
abstract SelectionKey |
SelectableChannel.register(Selector sel, int ops, Object att)
用所给的选择器来注册这个通道,返回一个选择键。
|
Modifier and Type | Method and Description |
---|---|
abstract Set<SelectionKey> |
Selector.keys()
返回这个选择器的键集。
|
abstract Set<SelectionKey> |
Selector.selectedKeys()
返回此选择器选择的键集。
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractSelectionKey
用于选择键的基类实现类。
|
Modifier and Type | Method and Description |
---|---|
SelectionKey |
AbstractSelectableChannel.keyFor(Selector sel) |
protected abstract SelectionKey |
AbstractSelector.register(AbstractSelectableChannel ch, int ops, Object att)
用这个选择器寄存器指定给定的通道。
|
SelectionKey |
AbstractSelectableChannel.register(Selector sel, int ops, Object att)
用所给的选择器来注册这个通道,返回一个选择键。
|
Modifier and Type | Method and Description |
---|---|
protected Set<SelectionKey> |
AbstractSelector.cancelledKeys()
检索此选择器已取消的键集。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.