Package io.netty.channel.socket.oio
Class OioSocketChannel
- java.lang.Object
-
- io.netty.util.DefaultAttributeMap
-
- io.netty.channel.AbstractChannel
-
- io.netty.channel.oio.AbstractOioChannel
-
- io.netty.channel.oio.AbstractOioByteChannel
-
- io.netty.channel.oio.OioByteStreamChannel
-
- io.netty.channel.socket.oio.OioSocketChannel
-
- All Implemented Interfaces:
Channel
,ChannelOutboundInvoker
,DuplexChannel
,SocketChannel
,AttributeMap
,java.lang.Comparable<Channel>
@Deprecated public class OioSocketChannel extends OioByteStreamChannel implements SocketChannel
Deprecated.use NIO / EPOLL / KQUEUE transport.ASocketChannel
which is using Old-Blocking-IO
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.netty.channel.AbstractChannel
AbstractChannel.AbstractUnsafe
-
Nested classes/interfaces inherited from interface io.netty.channel.Channel
Channel.Unsafe
-
-
Field Summary
-
Fields inherited from class io.netty.channel.oio.AbstractOioChannel
SO_TIMEOUT
-
-
Constructor Summary
Constructors Constructor Description OioSocketChannel()
Deprecated.Create a new instance with an newSocket
OioSocketChannel(Channel parent, java.net.Socket socket)
Deprecated.Create a new instance from the givenSocket
OioSocketChannel(java.net.Socket socket)
Deprecated.Create a new instance from the givenSocket
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected boolean
checkInputShutdown()
Deprecated.OioSocketChannelConfig
config()
Deprecated.Returns the configuration of this channel.protected void
doBind(java.net.SocketAddress localAddress)
Deprecated.Bind theChannel
to theSocketAddress
protected void
doClose()
Deprecated.Close theChannel
protected void
doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)
Deprecated.Connect to the remote peer using the given localAddress if one is specified ornull
otherwise.protected void
doDisconnect()
Deprecated.Disconnect thisChannel
from its remote peerprotected int
doReadBytes(ByteBuf buf)
Deprecated.Read bytes from the underlying Socket.protected void
doShutdownOutput()
Deprecated.Called when conditions justify shutting down the output portion of the channel.boolean
isActive()
Deprecated.Returntrue
if theChannel
is active and so connected.boolean
isInputShutdown()
Deprecated.Determine if the input side of this channel is shutdown.boolean
isOpen()
Deprecated.Returnstrue
if theChannel
is open and may get active laterboolean
isOutputShutdown()
Deprecated.boolean
isShutdown()
Deprecated.Determine if both the input and output of this channel have been shutdown.java.net.InetSocketAddress
localAddress()
Deprecated.Returns the local address where this channel is bound to.protected java.net.SocketAddress
localAddress0()
Deprecated.Returns theSocketAddress
which is bound locally.ServerSocketChannel
parent()
Deprecated.Returns the parent of this channel.java.net.InetSocketAddress
remoteAddress()
Deprecated.Returns the remote address where this channel is connected to.protected java.net.SocketAddress
remoteAddress0()
Deprecated.Return theSocketAddress
which theChannel
is connected to.protected void
setReadPending(boolean readPending)
Deprecated.ChannelFuture
shutdown()
Deprecated.Will shutdown the input and output sides of this channel.ChannelFuture
shutdown(ChannelPromise promise)
Deprecated.Will shutdown the input and output sides of this channel.ChannelFuture
shutdownInput()
Deprecated.Shutdown the input side of this channel.ChannelFuture
shutdownInput(ChannelPromise promise)
Deprecated.Will shutdown the input and notifyChannelPromise
.ChannelFuture
shutdownOutput()
Deprecated.ChannelFuture
shutdownOutput(ChannelPromise promise)
Deprecated.Will shutdown the output and notifyChannelPromise
.-
Methods inherited from class io.netty.channel.oio.OioByteStreamChannel
activate, available, doWriteBytes, doWriteFileRegion
-
Methods inherited from class io.netty.channel.oio.AbstractOioByteChannel
doRead, doWrite, filterOutboundMessage, metadata
-
Methods inherited from class io.netty.channel.oio.AbstractOioChannel
clearReadPending, doBeginRead, isCompatible, isReadPending, newUnsafe
-
Methods inherited from class io.netty.channel.AbstractChannel
closeFuture, compareTo, doDeregister, doRegister, doRegister, equals, eventLoop, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, maxMessagesPerWrite, newChannelPipeline, newId, pipeline, toString, unsafe, validateFileRegion, voidPromise
-
Methods inherited from class io.netty.util.DefaultAttributeMap
attr, hasAttr
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty.util.AttributeMap
attr, hasAttr
-
Methods inherited from interface io.netty.channel.Channel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, eventLoop, flush, getOption, id, isRegistered, isWritable, metadata, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, setOption, unsafe, voidPromise, write, write, writeAndFlush, writeAndFlush
-
-
-
-
Constructor Detail
-
OioSocketChannel
public OioSocketChannel()
Deprecated.Create a new instance with an newSocket
-
OioSocketChannel
public OioSocketChannel(java.net.Socket socket)
Deprecated.Create a new instance from the givenSocket
- Parameters:
socket
- theSocket
which is used by this instance
-
OioSocketChannel
public OioSocketChannel(Channel parent, java.net.Socket socket)
Deprecated.Create a new instance from the givenSocket
- Parameters:
parent
- the parentChannel
which was used to create this instance. This can be null if the has no parent as it was created by your self.socket
- theSocket
which is used by this instance
-
-
Method Detail
-
parent
public ServerSocketChannel parent()
Deprecated.Description copied from interface:Channel
Returns the parent of this channel.- Specified by:
parent
in interfaceChannel
- Specified by:
parent
in interfaceSocketChannel
- Overrides:
parent
in classAbstractChannel
- Returns:
- the parent channel.
null
if this channel does not have a parent channel.
-
config
public OioSocketChannelConfig config()
Deprecated.Description copied from interface:Channel
Returns the configuration of this channel.- Specified by:
config
in interfaceChannel
- Specified by:
config
in interfaceSocketChannel
-
isOpen
public boolean isOpen()
Deprecated.Description copied from interface:Channel
Returnstrue
if theChannel
is open and may get active later
-
isActive
public boolean isActive()
Deprecated.Description copied from interface:Channel
Returntrue
if theChannel
is active and so connected.- Specified by:
isActive
in interfaceChannel
- Overrides:
isActive
in classOioByteStreamChannel
-
isOutputShutdown
public boolean isOutputShutdown()
Deprecated.- Specified by:
isOutputShutdown
in interfaceDuplexChannel
- See Also:
Socket.isOutputShutdown()
-
isInputShutdown
public boolean isInputShutdown()
Deprecated.Description copied from class:AbstractOioByteChannel
Determine if the input side of this channel is shutdown.- Specified by:
isInputShutdown
in interfaceDuplexChannel
- Specified by:
isInputShutdown
in classAbstractOioByteChannel
- Returns:
true
if the input side of this channel is shutdown.
-
isShutdown
public boolean isShutdown()
Deprecated.Description copied from interface:DuplexChannel
Determine if both the input and output of this channel have been shutdown.- Specified by:
isShutdown
in interfaceDuplexChannel
-
doShutdownOutput
protected final void doShutdownOutput() throws java.lang.Exception
Deprecated.Description copied from class:AbstractChannel
Called when conditions justify shutting down the output portion of the channel. This may happen if a write operation throws an exception.- Overrides:
doShutdownOutput
in classAbstractChannel
- Throws:
java.lang.Exception
-
shutdownOutput
public ChannelFuture shutdownOutput()
Deprecated.- Specified by:
shutdownOutput
in interfaceDuplexChannel
- See Also:
Socket.shutdownOutput()
-
shutdownInput
public ChannelFuture shutdownInput()
Deprecated.Description copied from class:AbstractOioByteChannel
Shutdown the input side of this channel.- Specified by:
shutdownInput
in interfaceDuplexChannel
- Specified by:
shutdownInput
in classAbstractOioByteChannel
- Returns:
- A channel future that will complete when the shutdown is complete.
- See Also:
Socket.shutdownInput()
-
shutdown
public ChannelFuture shutdown()
Deprecated.Description copied from interface:DuplexChannel
Will shutdown the input and output sides of this channel.- Specified by:
shutdown
in interfaceDuplexChannel
- Returns:
- will be completed when both shutdown operations complete.
-
doReadBytes
protected int doReadBytes(ByteBuf buf) throws java.lang.Exception
Deprecated.Description copied from class:AbstractOioByteChannel
Read bytes from the underlying Socket.- Overrides:
doReadBytes
in classOioByteStreamChannel
- Parameters:
buf
- theByteBuf
into which the read bytes will be written- Returns:
- amount the number of bytes read. This may return a negative amount if the underlying Socket was closed
- Throws:
java.lang.Exception
- is thrown if an error occurred
-
shutdownOutput
public ChannelFuture shutdownOutput(ChannelPromise promise)
Deprecated.Description copied from interface:DuplexChannel
Will shutdown the output and notifyChannelPromise
.- Specified by:
shutdownOutput
in interfaceDuplexChannel
- See Also:
Socket.shutdownOutput()
-
shutdownInput
public ChannelFuture shutdownInput(ChannelPromise promise)
Deprecated.Description copied from interface:DuplexChannel
Will shutdown the input and notifyChannelPromise
.- Specified by:
shutdownInput
in interfaceDuplexChannel
- See Also:
Socket.shutdownInput()
-
shutdown
public ChannelFuture shutdown(ChannelPromise promise)
Deprecated.Description copied from interface:DuplexChannel
Will shutdown the input and output sides of this channel.- Specified by:
shutdown
in interfaceDuplexChannel
- Parameters:
promise
- will be completed when both shutdown operations complete.- Returns:
- will be completed when both shutdown operations complete.
-
localAddress
public java.net.InetSocketAddress localAddress()
Deprecated.Description copied from interface:Channel
Returns the local address where this channel is bound to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Specified by:
localAddress
in interfaceChannel
- Specified by:
localAddress
in interfaceSocketChannel
- Overrides:
localAddress
in classAbstractChannel
- Returns:
- the local address of this channel.
null
if this channel is not bound.
-
remoteAddress
public java.net.InetSocketAddress remoteAddress()
Deprecated.Description copied from interface:Channel
Returns the remote address where this channel is connected to. The returnedSocketAddress
is supposed to be down-cast into more concrete type such asInetSocketAddress
to retrieve the detailed information.- Specified by:
remoteAddress
in interfaceChannel
- Specified by:
remoteAddress
in interfaceSocketChannel
- Overrides:
remoteAddress
in classAbstractChannel
- Returns:
- 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
, useDefaultAddressedEnvelope.recipient()
to determine the origination of the received message as this method will returnnull
.
-
localAddress0
protected java.net.SocketAddress localAddress0()
Deprecated.Description copied from class:AbstractChannel
Returns theSocketAddress
which is bound locally.- Specified by:
localAddress0
in classAbstractChannel
-
remoteAddress0
protected java.net.SocketAddress remoteAddress0()
Deprecated.Description copied from class:AbstractChannel
Return theSocketAddress
which theChannel
is connected to.- Specified by:
remoteAddress0
in classAbstractChannel
-
doBind
protected void doBind(java.net.SocketAddress localAddress) throws java.lang.Exception
Deprecated.Description copied from class:AbstractChannel
Bind theChannel
to theSocketAddress
- Specified by:
doBind
in classAbstractChannel
- Throws:
java.lang.Exception
-
doConnect
protected void doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.Exception
Deprecated.Description copied from class:AbstractOioChannel
Connect to the remote peer using the given localAddress if one is specified ornull
otherwise.- Specified by:
doConnect
in classAbstractOioChannel
- Throws:
java.lang.Exception
-
doDisconnect
protected void doDisconnect() throws java.lang.Exception
Deprecated.Description copied from class:AbstractChannel
Disconnect thisChannel
from its remote peer- Specified by:
doDisconnect
in classAbstractChannel
- Throws:
java.lang.Exception
-
doClose
protected void doClose() throws java.lang.Exception
Deprecated.Description copied from class:AbstractChannel
Close theChannel
- Overrides:
doClose
in classOioByteStreamChannel
- Throws:
java.lang.Exception
-
checkInputShutdown
protected boolean checkInputShutdown()
Deprecated.
-
setReadPending
@Deprecated protected void setReadPending(boolean readPending)
Deprecated.- Overrides:
setReadPending
in classAbstractOioChannel
-
-