public enum ChannelState extends java.lang.Enum<ChannelState>
Channel.
The state of a Channel is interpreted differently depending on the
value of a ChannelStateEvent
and the direction of the event in a ChannelPipeline:
| Direction | State | Value | Meaning |
|---|---|---|---|
| Upstream | OPEN |
true | The channel is open. |
| Upstream | OPEN |
false | The channel is closed. |
| Upstream | BOUND |
SocketAddress | The channel is bound to a local address. |
| Upstream | BOUND |
null | The channel is unbound to a local address. |
| Upstream | CONNECTED |
SocketAddress | The channel is connected to a remote address. |
| Upstream | CONNECTED |
null | The channel is disconnected from a remote address. |
| Upstream | INTEREST_OPS |
an integer | The channel interestOps has been changed. |
| Downstream | OPEN |
true | N/A |
| Downstream | OPEN |
false | Close the channel. |
| Downstream | BOUND |
SocketAddress | Bind the channel to the specified local address. |
| Downstream | BOUND |
null | Unbind the channel from the current local address. |
| Downstream | CONNECTED |
SocketAddress | Connect the channel to the specified remote address. |
| Downstream | CONNECTED |
null | Disconnect the channel from the current remote address. |
| Downstream | INTEREST_OPS |
an integer | Change the interestOps of the channel. |
To see how an event is interpreted further, please refer to ChannelEvent.
| 枚举常量和说明 |
|---|
BOUND
|
CONNECTED
|
INTEREST_OPS
Represents a
Channel's interestOps
property |
OPEN
|
| 限定符和类型 | 方法和说明 |
|---|---|
static ChannelState |
valueOf(java.lang.String name)
返回带有指定名称的该类型的枚举常量。
|
static ChannelState[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
public static final ChannelState OPEN
public static final ChannelState BOUND
public static final ChannelState CONNECTED
public static final ChannelState INTEREST_OPS
Channel's interestOps
propertypublic static ChannelState[] values()
for (ChannelState c : ChannelState.values()) System.out.println(c);
public static ChannelState valueOf(java.lang.String name)
name - 要返回的枚举常量的名称。java.lang.IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量java.lang.NullPointerException - 如果参数为空值