public abstract class AbstractServerChannel extends AbstractChannel implements ServerChannel
Channel implementation. A server-side
Channel does not allow the following operations:
connect(SocketAddress)disconnect()getInterestOps()setInterestOps(int)write(Object)write(Object, SocketAddress)OP_NONE, OP_READ, OP_READ_WRITE, OP_WRITE| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractServerChannel(ChannelFactory factory,
ChannelPipeline pipeline,
ChannelSink sink)
Creates a new instance.
|
| 限定符和类型 | 方法和说明 |
|---|---|
ChannelFuture |
connect(java.net.SocketAddress remoteAddress)
Connects this channel to the specified remote address asynchronously.
|
ChannelFuture |
disconnect()
Disconnects this channel from the current remote address asynchronously.
|
int |
getInterestOps()
Returns the current
interestOps of this channel. |
boolean |
isConnected()
Returns
true if and only if this channel is connected to a
remote address. |
ChannelFuture |
setInterestOps(int interestOps)
Changes the
interestOps of this channel asynchronously. |
protected void |
setInternalInterestOps(int interestOps)
Sets the
interestOps property of this channel
immediately. |
ChannelFuture |
write(java.lang.Object message)
Sends a message to this channel asynchronously.
|
ChannelFuture |
write(java.lang.Object message,
java.net.SocketAddress remoteAddress)
Sends a message to this channel asynchronously.
|
bind, close, compareTo, equals, getAttachment, getCloseFuture, getFactory, getId, getInternalInterestOps, getParent, getPipeline, getSucceededFuture, getUnsupportedOperationFuture, getUserDefinedWritability, hashCode, isOpen, isReadable, isWritable, setAttachment, setClosed, setReadable, setUnwritable, setUserDefinedWritability, setWritable, toString, unbindbind, close, getAttachment, getCloseFuture, getConfig, getFactory, getId, getLocalAddress, getParent, getPipeline, getRemoteAddress, getUserDefinedWritability, isBound, isOpen, isReadable, isWritable, setAttachment, setReadable, setUserDefinedWritability, unbindprotected AbstractServerChannel(ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink)
factory - the factory which created this channelpipeline - the pipeline which is going to be attached to this channelsink - the sink which will receive downstream events from the pipeline
and send upstream events to the pipelinepublic ChannelFuture connect(java.net.SocketAddress remoteAddress)
Channelconnect 在接口中 Channelconnect 在类中 AbstractChannelremoteAddress - where to connectChannelFuture which will be notified when the
connection request succeeds or failspublic ChannelFuture disconnect()
Channeldisconnect 在接口中 Channeldisconnect 在类中 AbstractChannelChannelFuture which will be notified when the
disconnection request succeeds or failspublic int getInterestOps()
ChannelinterestOps of this channel.getInterestOps 在接口中 ChannelgetInterestOps 在类中 AbstractChannelChannel.OP_NONE, Channel.OP_READ, Channel.OP_WRITE, or
Channel.OP_READ_WRITEpublic ChannelFuture setInterestOps(int interestOps)
ChannelinterestOps of this channel asynchronously.setInterestOps 在接口中 ChannelsetInterestOps 在类中 AbstractChannelinterestOps - the new interestOpsChannelFuture which will be notified when the
interestOps change request succeeds or failsprotected void setInternalInterestOps(int interestOps)
AbstractChannelinterestOps property of this channel
immediately. This method is intended to be called by an internal
component - please do not call it unless you know what you are doing.public ChannelFuture write(java.lang.Object message)
ChannelDatagramChannel)
and is not connected yet, you have to call Channel.write(Object, SocketAddress)
instead. Otherwise, the write request will fail with
NotYetConnectedException and an 'exceptionCaught' event
will be triggered.write 在接口中 Channelwrite 在类中 AbstractChannelmessage - the message to writeChannelFuture which will be notified when the
write request succeeds or failspublic ChannelFuture write(java.lang.Object message, java.net.SocketAddress remoteAddress)
ChannelDatagramChannel)
and is not connected yet, you must specify non-null address. Otherwise,
the write request will fail with NotYetConnectedException and
an 'exceptionCaught' event will be triggered.write 在接口中 Channelwrite 在类中 AbstractChannelmessage - the message to writeremoteAddress - where to send the specified message.
This method is identical to Channel.write(Object)
if null is specified here.ChannelFuture which will be notified when the
write request succeeds or failspublic boolean isConnected()
Channeltrue if and only if this channel is connected to a
remote address.isConnected 在接口中 Channel