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

public Class OioServerSocketChannel

extends AbstractOioMessageChannel
implements ServerSocketChannel
Class Inheritance
All Implemented Interfaces
io.netty.channel.socket.ServerSocketChannel, io.netty.channel.ServerChannel, io.netty.channel.Channel, java.lang.Comparable, io.netty.channel.ChannelOutboundInvoker, io.netty.util.AttributeMap
Annotations
@Deprecated
Imports
io.netty.channel.ChannelException, .ChannelMetadata, .ChannelOutboundBuffer, io.netty.channel.oio.AbstractOioMessageChannel, io.netty.channel.socket.ServerSocketChannel, io.netty.util.internal.ObjectUtil, .SocketUtils, io.netty.util.internal.logging.InternalLogger, .InternalLoggerFactory, java.io.IOException, java.net.InetSocketAddress, .ServerSocket, .Socket, .SocketAddress, .SocketTimeoutException, java.util.List

Deprecated

use NIO / EPOLL / KQUEUE transport.

ServerSocketChannel which accepts new connections and create the OioSocketChannel's for them. This implementation use Old-Blocking-IO.

Field Summary

Modifier and TypeField and Description
private final OioServerSocketChannelConfig
config

Deprecated as a consequence of OioServerSocketChannelConfig being deprecated.
private static final InternalLogger
private static final ChannelMetadata
pack-priv final ServerSocket

Constructor Summary

AccessConstructor and Description
public
OioServerSocketChannel()

Create a new instance with an new Socket

public
OioServerSocketChannel(ServerSocket
the ServerSocket which is used by this instance
socket
)

Create a new instance from the given ServerSocket

Method Summary

Modifier and TypeMethod and Description
pack-priv final void
public OioServerSocketChannelConfig
config()

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

Deprecated as a consequence of OioServerSocketChannelConfig 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
doReadMessages(List<Object> buf)

Implements abstract io.netty.channel.oio.AbstractOioMessageChannel.doReadMessages.

Read messages into the given array and return the amount which was read.
protected void
doWrite(ChannelOutboundBuffer in)

Implements abstract io.netty.channel.AbstractChannel.doWrite.

Flush the content of the given buffer to the remote peer.
protected Object
filterOutboundMessage(Object msg)

Overrides io.netty.channel.AbstractChannel.filterOutboundMessage.

Invoked when a new message is added to a ChannelOutboundBuffer of this AbstractChannel, so that the Channel implementation converts the message to another.
public boolean
isActive()

Implements io.netty.channel.Channel.isActive.

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

Implements io.netty.channel.Channel.isOpen.

Returns true if the Channel is open and may get active later
public InetSocketAddress
protected SocketAddress
localAddress0()

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

Returns the SocketAddress which is bound locally.
public ChannelMetadata
metadata()

Implements io.netty.channel.Channel.metadata.

Return the ChannelMetadata of the Channel which describe the nature of the Channel.
private static ServerSocket
public InetSocketAddress
protected SocketAddress
remoteAddress0()

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

Return the SocketAddress which the Channel is connected to.
protected void
Inherited from io.netty.channel.oio.AbstractOioMessageChannel:
doRead

Field Detail

configback to summary
private final OioServerSocketChannelConfig config

Deprecated

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

loggerback to summary
private static final InternalLogger logger

Hides io.netty.channel.AbstractChannel.logger.

METADATAback to summary
private static final ChannelMetadata METADATA
socketback to summary
pack-priv final ServerSocket socket

Constructor Detail

OioServerSocketChannelback to summary
public OioServerSocketChannel()

Create a new instance with an new Socket

OioServerSocketChannelback to summary
public OioServerSocketChannel(ServerSocket socket)

Create a new instance from the given ServerSocket

Parameters
socket:ServerSocket

the ServerSocket which is used by this instance

Method Detail

clearReadPending0back to summary
pack-priv final void clearReadPending0()
configback to summary
public OioServerSocketChannelConfig config()

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

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

Deprecated

as a consequence of OioServerSocketChannelConfig 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

Implements abstract io.netty.channel.AbstractChannel.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
doReadMessagesback to summary
protected int doReadMessages(List<Object> buf) throws Exception

Implements abstract io.netty.channel.oio.AbstractOioMessageChannel.doReadMessages.

Doc from io.netty.channel.oio.AbstractOioMessageChannel.doReadMessages.

Read messages into the given array and return the amount which was read.

Annotations
@Override
doWriteback to summary
protected void doWrite(ChannelOutboundBuffer in) throws Exception

Implements abstract io.netty.channel.AbstractChannel.doWrite.

Doc from io.netty.channel.AbstractChannel.doWrite.

Flush the content of the given buffer to the remote peer.

Annotations
@Override
filterOutboundMessageback to summary
protected Object filterOutboundMessage(Object msg) throws Exception

Overrides io.netty.channel.AbstractChannel.filterOutboundMessage.

Doc from io.netty.channel.AbstractChannel.filterOutboundMessage.

Invoked when a new message is added to a ChannelOutboundBuffer of this AbstractChannel, so that the Channel implementation converts the message to another. (e.g. heap buffer -> direct buffer)

Annotations
@Override
isActiveback to summary
public boolean 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
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
localAddressback to summary
public InetSocketAddress localAddress()

Overrides io.netty.channel.AbstractChannel.localAddress.

Implements io.netty.channel.socket.ServerSocketChannel.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
metadataback to summary
public ChannelMetadata metadata()

Implements io.netty.channel.Channel.metadata.

Doc from io.netty.channel.Channel.metadata.

Return the ChannelMetadata of the Channel which describe the nature of the Channel.

Annotations
@Override
newServerSocketback to summary
private static ServerSocket newServerSocket()
remoteAddressback to summary
public InetSocketAddress remoteAddress()

Overrides io.netty.channel.AbstractChannel.remoteAddress.

Implements io.netty.channel.socket.ServerSocketChannel.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