Top Description Fields Constructors Methods
io.netty.channel.socket.oio

public Class OioSocketChannel

extends OioByteStreamChannel
implements SocketChannel
Class Inheritance
All Implemented Interfaces
io.netty.channel.socket.SocketChannel, io.netty.channel.socket.DuplexChannel, io.netty.channel.Channel, java.lang.Comparable, io.netty.channel.ChannelOutboundInvoker, io.netty.util.AttributeMap
Annotations
@Deprecated
Imports
io.netty.buffer.ByteBuf, io.netty.channel.Channel, .ChannelException, .ChannelFuture, .ChannelFutureListener, .ChannelPromise, .ConnectTimeoutException, .EventLoop, io.netty.channel.oio.OioByteStreamChannel, io.netty.channel.socket.ServerSocketChannel, .SocketChannel, io.netty.util.internal.SocketUtils, .UnstableApi, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.io.IOException, java.net.InetSocketAddress, .Socket, .SocketAddress, .SocketTimeoutException

Deprecated

use NIO / EPOLL / KQUEUE transport.

A SocketChannel which is using Old-Blocking-IO

Field Summary

Modifier and TypeField and Description
private final OioSocketChannelConfig
config

Deprecated as a consequence of OioSocketChannelConfig being deprecated.
private static final InternalLogger
private final Socket

Constructor Summary

AccessConstructor and Description
public
OioSocketChannel()

Create a new instance with an new Socket

public
OioSocketChannel(Socket
the Socket which is used by this instance
socket
)

Create a new instance from the given Socket

public
OioSocketChannel(Channel
the parent Channel which was used to create this instance. This can be null if the has no parent as it was created by your self.
parent
,
Socket
the Socket which is used by this instance
socket
)

Create a new instance from the given Socket

Method Summary

Modifier and TypeMethod and Description
protected boolean
pack-priv final void
public OioSocketChannelConfig
config()

Implements io.netty.channel.socket.SocketChannel.config, io.netty.channel.Channel.config.

Deprecated as a consequence of OioSocketChannelConfig being deprecated.
Returns the configuration of this channel.
protected void
doBind(SocketAddress localAddress)

Implements abstract io.netty.channel.AbstractChannel.doBind.

Bind the Channel to the SocketAddress
protected void
protected void
doConnect(SocketAddress remoteAddress, SocketAddress localAddress)

Implements abstract io.netty.channel.oio.AbstractOioChannel.doConnect.

Connect to the remote peer using the given localAddress if one is specified or null otherwise.
protected void
doDisconnect()

Implements abstract io.netty.channel.AbstractChannel.doDisconnect.

Disconnect this Channel from its remote peer
protected int
doReadBytes(ByteBuf
the ByteBuf into which the read bytes will be written
buf
)

Overrides io.netty.channel.oio.OioByteStreamChannel.doReadBytes.

Read bytes from the underlying Socket.
protected final void
doShutdownOutput()

Overrides io.netty.channel.AbstractChannel.doShutdownOutput.

Called when conditions justify shutting down the output portion of the channel.
public boolean
isActive()

Overrides io.netty.channel.oio.OioByteStreamChannel.isActive.

Implements io.netty.channel.Channel.isActive.

Return true if the Channel is active and so connected.
public boolean
isInputShutdown()

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.isInputShutdown.

Implements io.netty.channel.socket.DuplexChannel.isInputShutdown.

Returns true if and only if the remote peer shut down its output so that no more data is received from this channel.
public boolean
isOpen()

Implements io.netty.channel.Channel.isOpen.

Returns true if the Channel is open and may get active later
public boolean
public boolean
isShutdown()

Implements io.netty.channel.socket.DuplexChannel.isShutdown.

Determine if both the input and output of this channel have been shutdown.
public InetSocketAddress
protected SocketAddress
localAddress0()

Implements abstract io.netty.channel.AbstractChannel.localAddress0.

Returns the SocketAddress which is bound locally.
public ServerSocketChannel
public InetSocketAddress
protected SocketAddress
remoteAddress0()

Implements abstract io.netty.channel.AbstractChannel.remoteAddress0.

Return the SocketAddress which the Channel is connected to.
protected void
public ChannelFuture
shutdown()

Implements io.netty.channel.socket.DuplexChannel.shutdown.

Will shutdown the input and output sides of this channel.
public ChannelFuture
shutdown(final ChannelPromise
will be completed when both shutdown operations complete.
promise
)

Implements io.netty.channel.socket.DuplexChannel.shutdown.

Will shutdown the input and output sides of this channel.
private static void
shutdownDone(ChannelFuture shutdownOutputFuture, ChannelFuture shutdownInputFuture, ChannelPromise promise)

public ChannelFuture
public ChannelFuture
shutdownInput(final ChannelPromise promise)

Implements io.netty.channel.socket.DuplexChannel.shutdownInput.

Will shutdown the input and notify ChannelPromise.
private void
public ChannelFuture
public ChannelFuture
shutdownOutput(final ChannelPromise promise)

Implements io.netty.channel.socket.DuplexChannel.shutdownOutput.

Will shutdown the output and notify ChannelPromise.
private void
private void
private void
shutdownOutputDone(final ChannelFuture shutdownOutputFuture, final ChannelPromise promise)

Inherited from io.netty.channel.oio.OioByteStreamChannel:
activateavailabledoWriteBytesdoWriteFileRegion

Field Detail

configback to summary
private final OioSocketChannelConfig config

Deprecated

as a consequence of OioSocketChannelConfig being deprecated. See corresponding docs for further information.

loggerback to summary
private static final InternalLogger logger

Hides io.netty.channel.AbstractChannel.logger.

socketback to summary
private final Socket socket

Constructor Detail

OioSocketChannelback to summary
public OioSocketChannel()

Create a new instance with an new Socket

OioSocketChannelback to summary
public OioSocketChannel(Socket socket)

Create a new instance from the given Socket

Parameters
socket:Socket

the Socket which is used by this instance

OioSocketChannelback to summary
public OioSocketChannel(Channel parent, Socket socket)

Create a new instance from the given Socket

Parameters
parent:Channel

the parent Channel which was used to create this instance. This can be null if the has no parent as it was created by your self.

socket:Socket

the Socket which is used by this instance

Method Detail

checkInputShutdownback to summary
protected boolean checkInputShutdown()
clearReadPending0back to summary
pack-priv final void clearReadPending0()
configback to summary
public OioSocketChannelConfig config()

Implements io.netty.channel.socket.SocketChannel.config, io.netty.channel.Channel.config.

Doc from io.netty.channel.Channel.config.

Deprecated

as a consequence of OioSocketChannelConfig being deprecated. See corresponding docs for further information.

Returns the configuration of this channel.

Annotations
@Override
doBindback to summary
protected void doBind(SocketAddress localAddress) throws Exception

Implements abstract io.netty.channel.AbstractChannel.doBind.

Doc from io.netty.channel.AbstractChannel.doBind.

Bind the Channel to the SocketAddress

Annotations
@Override
doCloseback to summary
protected void doClose() throws Exception

Overrides io.netty.channel.oio.OioByteStreamChannel.doClose.

Doc from io.netty.channel.AbstractChannel.doClose.

Close the Channel

Annotations
@Override
doConnectback to summary
protected void doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception

Implements abstract io.netty.channel.oio.AbstractOioChannel.doConnect.

Doc from io.netty.channel.oio.AbstractOioChannel.doConnect.

Connect to the remote peer using the given localAddress if one is specified or null otherwise.

Annotations
@Override
doDisconnectback to summary
protected void doDisconnect() throws Exception

Implements abstract io.netty.channel.AbstractChannel.doDisconnect.

Doc from io.netty.channel.AbstractChannel.doDisconnect.

Disconnect this Channel from its remote peer

Annotations
@Override
doReadBytesback to summary
protected int doReadBytes(ByteBuf buf) throws Exception

Overrides io.netty.channel.oio.OioByteStreamChannel.doReadBytes.

Doc from io.netty.channel.oio.AbstractOioByteChannel.doReadBytes.

Read bytes from the underlying Socket.

Parameters
buf:ByteBuf

the ByteBuf into which the read bytes will be written

Returns:int

amount the number of bytes read. This may return a negative amount if the underlying Socket was closed

Annotations
@Override
Exceptions
Exception:
is thrown if an error occurred
doShutdownOutputback to summary
protected final void doShutdownOutput() throws Exception

Overrides io.netty.channel.AbstractChannel.doShutdownOutput.

Doc from io.netty.channel.AbstractChannel.doShutdownOutput.

Called when conditions justify shutting down the output portion of the channel. This may happen if a write operation throws an exception.

Annotations
@UnstableApi
@Override
isActiveback to summary
public boolean isActive()

Overrides io.netty.channel.oio.OioByteStreamChannel.isActive.

Implements io.netty.channel.Channel.isActive.

Doc from io.netty.channel.Channel.isActive.

Return true if the Channel is active and so connected.

Annotations
@Override
isInputShutdownback to summary
public boolean isInputShutdown()

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.isInputShutdown.

Implements io.netty.channel.socket.DuplexChannel.isInputShutdown.

Doc from io.netty.channel.socket.DuplexChannel.isInputShutdown.

Returns true 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().

Returns:boolean

Doc from io.netty.channel.oio.AbstractOioByteChannel.isInputShutdown.

true if the input side of this channel is shutdown.

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements io.netty.channel.Channel.isOpen.

Doc from io.netty.channel.Channel.isOpen.

Returns true if the Channel is open and may get active later

Annotations
@Override
isOutputShutdownback to summary
public boolean isOutputShutdown()

Implements io.netty.channel.socket.DuplexChannel.isOutputShutdown.

Annotations
@Override
isShutdownback to summary
public boolean isShutdown()

Implements io.netty.channel.socket.DuplexChannel.isShutdown.

Doc from io.netty.channel.socket.DuplexChannel.isShutdown.

Determine if both the input and output of this channel have been shutdown.

Annotations
@Override
localAddressback to summary
public InetSocketAddress localAddress()

Overrides io.netty.channel.AbstractChannel.localAddress.

Implements io.netty.channel.socket.SocketChannel.localAddress, io.netty.channel.Channel.localAddress.

Doc from io.netty.channel.Channel.localAddress.

Returns the local address where this channel is bound to. The returned SocketAddress is supposed to be down-cast into more concrete type such as InetSocketAddress to retrieve the detailed information.

Returns:InetSocketAddress

the local address of this channel. null if this channel is not bound.

Annotations
@Override
localAddress0back to summary
protected SocketAddress localAddress0()

Implements abstract io.netty.channel.AbstractChannel.localAddress0.

Doc from io.netty.channel.AbstractChannel.localAddress0.

Returns the SocketAddress which is bound locally.

Annotations
@Override
parentback to summary
public ServerSocketChannel parent()

Overrides io.netty.channel.AbstractChannel.parent.

Implements io.netty.channel.socket.SocketChannel.parent, io.netty.channel.Channel.parent.

Doc from io.netty.channel.Channel.parent.

Returns the parent of this channel.

Returns:ServerSocketChannel

the parent channel. null if this channel does not have a parent channel.

Annotations
@Override
remoteAddressback to summary
public InetSocketAddress remoteAddress()

Overrides io.netty.channel.AbstractChannel.remoteAddress.

Implements io.netty.channel.socket.SocketChannel.remoteAddress, io.netty.channel.Channel.remoteAddress.

Doc from io.netty.channel.Channel.remoteAddress.

Returns the remote address where this channel is connected to. The returned SocketAddress is supposed to be down-cast into more concrete type such as InetSocketAddress to retrieve the detailed information.

Returns:InetSocketAddress

the remote address of this channel. null 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 DatagramPacket#recipient() to determine the origination of the received message as this method will return null.

Annotations
@Override
remoteAddress0back to summary
protected SocketAddress remoteAddress0()

Implements abstract io.netty.channel.AbstractChannel.remoteAddress0.

Doc from io.netty.channel.AbstractChannel.remoteAddress0.

Return the SocketAddress which the Channel is connected to.

Annotations
@Override
setReadPendingback to summary
protected void setReadPending(boolean readPending)

Overrides io.netty.channel.oio.AbstractOioChannel.setReadPending.

Deprecated

Annotations
@Deprecated
@Override
shutdownback to summary
public ChannelFuture shutdown()

Implements io.netty.channel.socket.DuplexChannel.shutdown.

Doc from io.netty.channel.socket.DuplexChannel.shutdown.

Will shutdown the input and output sides of this channel.

Returns:ChannelFuture

will be completed when both shutdown operations complete.

Annotations
@Override
shutdownback to summary
public ChannelFuture shutdown(final ChannelPromise promise)

Implements io.netty.channel.socket.DuplexChannel.shutdown.

Doc from io.netty.channel.socket.DuplexChannel.shutdown.

Will shutdown the input and output sides of this channel.

Parameters
promise:ChannelPromise

will be completed when both shutdown operations complete.

Returns:ChannelFuture

will be completed when both shutdown operations complete.

Annotations
@Override
shutdownDoneback to summary
private static void shutdownDone(ChannelFuture shutdownOutputFuture, ChannelFuture shutdownInputFuture, ChannelPromise promise)
shutdownInputback to summary
public ChannelFuture shutdownInput()

Implements abstract io.netty.channel.oio.AbstractOioByteChannel.shutdownInput.

Implements io.netty.channel.socket.DuplexChannel.shutdownInput.

Doc from io.netty.channel.oio.AbstractOioByteChannel.shutdownInput.

Shutdown the input side of this channel.

Returns:ChannelFuture

A channel future that will complete when the shutdown is complete.

Annotations
@Override
shutdownInputback to summary
public ChannelFuture shutdownInput(final ChannelPromise promise)

Implements io.netty.channel.socket.DuplexChannel.shutdownInput.

Doc from io.netty.channel.socket.DuplexChannel.shutdownInput.

Will shutdown the input and notify ChannelPromise.

Annotations
@Override
shutdownInput0back to summary
private void shutdownInput0(ChannelPromise promise)
shutdownOutputback to summary
public ChannelFuture shutdownOutput()

Implements io.netty.channel.socket.DuplexChannel.shutdownOutput.

Annotations
@Override
shutdownOutputback to summary
public ChannelFuture shutdownOutput(final ChannelPromise promise)

Implements io.netty.channel.socket.DuplexChannel.shutdownOutput.

Doc from io.netty.channel.socket.DuplexChannel.shutdownOutput.

Will shutdown the output and notify ChannelPromise.

Annotations
@Override
shutdownOutput0back to summary
private void shutdownOutput0(ChannelPromise promise)
shutdownOutput0back to summary
private void shutdownOutput0() throws IOException
shutdownOutputDoneback to summary
private void shutdownOutputDone(final ChannelFuture shutdownOutputFuture, final ChannelPromise promise)