
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| Modifier | Constructor and Description |
|---|---|
protected |
AbstractServerChannel(ChannelFactory factory,
ChannelPipeline pipeline,
ChannelSink sink)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
ChannelFuture |
connect(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 |
setInterestOpsNow(int interestOps)
Sets the
interestOps property of this channel
immediately. |
ChannelFuture |
write(Object message)
Sends a message to this channel asynchronously.
|
ChannelFuture |
write(Object message,
SocketAddress remoteAddress)
Sends a message to this channel asynchronously.
|
bind, close, compareTo, equals, getAttachment, getCloseFuture, getFactory, getId, getParent, getPipeline, getSucceededFuture, getUnsupportedOperationFuture, hashCode, isOpen, isReadable, isWritable, setAttachment, setClosed, setReadable, toString, unbindclone, finalize, getClass, notify, notifyAll, wait, wait, waitbind, close, getAttachment, getCloseFuture, getConfig, getFactory, getId, getLocalAddress, getParent, getPipeline, getRemoteAddress, isBound, isOpen, isReadable, isWritable, setAttachment, setReadable, unbindcompareToprotected 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(SocketAddress remoteAddress)
Channelconnect in interface Channelconnect in class AbstractChannelremoteAddress - where to connectChannelFuture which will be notified when the
connection request succeeds or failspublic ChannelFuture disconnect()
Channeldisconnect in interface Channeldisconnect in class AbstractChannelChannelFuture which will be notified when the
disconnection request succeeds or failspublic int getInterestOps()
ChannelinterestOps of this channel.getInterestOps in interface ChannelgetInterestOps in class AbstractChannelChannel.OP_NONE, Channel.OP_READ, Channel.OP_WRITE, or
Channel.OP_READ_WRITEpublic ChannelFuture setInterestOps(int interestOps)
ChannelinterestOps of this channel asynchronously.setInterestOps in interface ChannelsetInterestOps in class AbstractChannelinterestOps - the new interestOpsChannelFuture which will be notified when the
interestOps change request succeeds or failsprotected void setInterestOpsNow(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.setInterestOpsNow in class AbstractChannelpublic ChannelFuture write(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 in interface Channelwrite in class AbstractChannelmessage - the message to writeChannelFuture which will be notified when the
write request succeeds or failspublic ChannelFuture write(Object message, 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 in interface Channelwrite in class 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 in interface ChannelCopyright © 2008-2013 The Netty Project. All Rights Reserved.