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()
Check if the input was shutdown and if so return
true. |
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()
Returns
true if and only if the remote peer shut down its output so that no more
data is received from this channel. |
boolean |
isOpen()
Returns
true if the Channel is open an may get active later |
boolean |
isOutputShutdown() |
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) |
ChannelFuture |
shutdownOutput() |
ChannelFuture |
shutdownOutput(ChannelPromise future) |
activate, available, doWriteBytes, doWriteFileRegiondoRead, doWrite, filterOutboundMessage, metadatadoBeginRead, isCompatible, isReadPending, newUnsafealloc, bind, bind, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doDeregister, doRegister, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, toString, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrclone, finalize, getClass, notify, notifyAll, wait, wait, waitalloc, bind, bind, close, close, closeFuture, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, eventLoop, flush, id, isRegistered, isWritable, metadata, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlushattr, hasAttrcompareTopublic 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 an may get active laterpublic boolean isActive()
Channeltrue if the Channel is active and so connected.isActive in interface ChannelisActive in class OioByteStreamChannelpublic boolean isInputShutdown()
SocketChanneltrue if and only if the remote peer shut down its output so that no more
data is received from this channel. Note that the semantic of this method is different from
that of Socket.shutdownInput() and Socket.isInputShutdown().isInputShutdown in interface SocketChannelisInputShutdown in class AbstractOioByteChannelpublic boolean isOutputShutdown()
isOutputShutdown in interface SocketChannelSocket.isOutputShutdown()public ChannelFuture shutdownOutput()
shutdownOutput in interface SocketChannelSocket.shutdownOutput()protected 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 future)
shutdownOutput in interface SocketChannelWill notify the given {@link ChannelPromise}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()
AbstractOioByteChanneltrue. The default implementation sleeps also for
AbstractOioChannel.SO_TIMEOUT milliseconds to simulate some blocking.checkInputShutdown in class AbstractOioByteChannelprotected void setReadPending(boolean readPending)
setReadPending in class AbstractOioChannelCopyright © 2008–2015 The Netty Project. All rights reserved.