public class OioSocketChannel extends OioByteStreamChannel implements SocketChannel
SocketChannel which is using Old-Blocking-IOAbstractChannel.AbstractUnsafeChannel.UnsafeSO_TIMEOUT| Constructor and Description |
|---|
OioSocketChannel()
Create a new instance with an new
Socket |
OioSocketChannel(Channel parent,
Socket socket)
Create a new instance from the given
Socket |
OioSocketChannel(Socket socket)
Create a new instance from the given
Socket |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkInputShutdown() |
OioSocketChannelConfig |
config()
Returns the configuration of this channel.
|
protected void |
doBind(SocketAddress localAddress)
Bind the
Channel to the SocketAddress |
protected void |
doClose()
Close the
Channel |
protected void |
doConnect(SocketAddress remoteAddress,
SocketAddress localAddress)
Connect to the remote peer using the given localAddress if one is specified or
null otherwise. |
protected void |
doDisconnect()
Disconnect this
Channel from its remote peer |
protected int |
doReadBytes(ByteBuf buf)
Read bytes from the underlying Socket.
|
boolean |
isActive()
Return
true if the Channel is active and so connected. |
boolean |
isInputShutdown()
Determine if the input side of this channel is shutdown.
|
boolean |
isOpen()
Returns
true if the Channel is open and may get active later |
boolean |
isOutputShutdown() |
boolean |
isShutdown()
Determine if both the input and output of this channel have been shutdown.
|
InetSocketAddress |
localAddress()
Returns the local address where this channel is bound to.
|
protected SocketAddress |
localAddress0()
Returns the
SocketAddress which is bound locally. |
ServerSocketChannel |
parent()
Returns the parent of this channel.
|
InetSocketAddress |
remoteAddress()
Returns the remote address where this channel is connected to.
|
protected SocketAddress |
remoteAddress0()
Return the
SocketAddress which the Channel is connected to. |
protected void |
setReadPending(boolean readPending)
Deprecated.
|
ChannelFuture |
shutdown()
Will shutdown the input and output sides of this channel.
|
ChannelFuture |
shutdown(ChannelPromise promise)
Will shutdown the input and output sides of this channel.
|
ChannelFuture |
shutdownInput()
Shutdown the input side of this channel.
|
ChannelFuture |
shutdownInput(ChannelPromise promise)
Will shutdown the input and notify
ChannelPromise. |
ChannelFuture |
shutdownOutput() |
ChannelFuture |
shutdownOutput(ChannelPromise promise)
Will shutdown the output and notify
ChannelPromise. |
activate, available, doWriteBytes, doWriteFileRegiondoRead, doWrite, filterOutboundMessage, metadataclearReadPending, doBeginRead, isCompatible, isReadPending, newUnsafealloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doDeregister, doRegister, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitalloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isRegistered, isWritable, metadata, pipeline, read, unsafeattr, hasAttrbind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlushcompareTopublic OioSocketChannel()
Socketpublic OioSocketChannel(Socket socket)
Socketsocket - the Socket which is used by this instancepublic ServerSocketChannel parent()
Channelparent in interface Channelparent in interface SocketChannelparent in class AbstractChannelnull if this channel does not have a parent channel.public OioSocketChannelConfig config()
Channelconfig in interface Channelconfig in interface SocketChannelpublic boolean isOpen()
Channeltrue if the Channel is open and may get active laterpublic boolean isActive()
Channeltrue if the Channel is active and so connected.isActive in interface ChannelisActive in class OioByteStreamChannelpublic boolean isOutputShutdown()
isOutputShutdown in interface DuplexChannelSocket.isOutputShutdown()public boolean isInputShutdown()
AbstractOioByteChannelisInputShutdown in interface DuplexChannelisInputShutdown in class AbstractOioByteChanneltrue if the input side of this channel is shutdown.public boolean isShutdown()
DuplexChannelisShutdown in interface DuplexChannelpublic ChannelFuture shutdownOutput()
shutdownOutput in interface DuplexChannelSocket.shutdownOutput()public ChannelFuture shutdownInput()
AbstractOioByteChannelshutdownInput in interface DuplexChannelshutdownInput in class AbstractOioByteChannelSocket.shutdownInput()public ChannelFuture shutdown()
DuplexChannelshutdown in interface DuplexChannelprotected int doReadBytes(ByteBuf buf) throws Exception
AbstractOioByteChanneldoReadBytes in class OioByteStreamChannelbuf - the ByteBuf into which the read bytes will be writtenException - is thrown if an error occurredpublic ChannelFuture shutdownOutput(ChannelPromise promise)
DuplexChannelChannelPromise.shutdownOutput in interface DuplexChannelSocket.shutdownOutput()public ChannelFuture shutdownInput(ChannelPromise promise)
DuplexChannelChannelPromise.shutdownInput in interface DuplexChannelSocket.shutdownInput()public ChannelFuture shutdown(ChannelPromise promise)
DuplexChannelshutdown in interface DuplexChannelpromise - will be completed when both shutdown operations complete.public InetSocketAddress localAddress()
ChannelSocketAddress is supposed to be down-cast into more concrete
type such as InetSocketAddress to retrieve the detailed
information.localAddress in interface ChannellocalAddress in interface SocketChannellocalAddress in class AbstractChannelnull if this channel is not bound.public InetSocketAddress remoteAddress()
ChannelSocketAddress is supposed to be down-cast into more
concrete type such as InetSocketAddress to retrieve the detailed
information.remoteAddress in interface ChannelremoteAddress in interface SocketChannelremoteAddress in class AbstractChannelnull if this channel is not connected.
If this channel is not connected but it can receive messages
from arbitrary remote addresses (e.g. DatagramChannel,
use DefaultAddressedEnvelope.recipient() to determine
the origination of the received message as this method will
return null.protected SocketAddress localAddress0()
AbstractChannelSocketAddress which is bound locally.localAddress0 in class AbstractChannelprotected SocketAddress remoteAddress0()
AbstractChannelSocketAddress which the Channel is connected to.remoteAddress0 in class AbstractChannelprotected void doBind(SocketAddress localAddress) throws Exception
AbstractChannelChannel to the SocketAddressdoBind in class AbstractChannelExceptionprotected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception
AbstractOioChannelnull otherwise.doConnect in class AbstractOioChannelExceptionprotected void doDisconnect()
throws Exception
AbstractChannelChannel from its remote peerdoDisconnect in class AbstractChannelExceptionprotected void doClose()
throws Exception
AbstractChannelChanneldoClose in class OioByteStreamChannelExceptionprotected boolean checkInputShutdown()
@Deprecated protected void setReadPending(boolean readPending)
setReadPending in class AbstractOioChannelCopyright © 2008–2017 The Netty Project. All rights reserved.