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.ASocketChannelwhich 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 newSocketOioSocketChannel(Channel parent, java.net.Socket socket)Deprecated.Create a new instance from the givenSocketOioSocketChannel(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 booleancheckInputShutdown()Deprecated.OioSocketChannelConfigconfig()Deprecated.Returns the configuration of this channel.protected voiddoBind(java.net.SocketAddress localAddress)Deprecated.Bind theChannelto theSocketAddressprotected voiddoClose()Deprecated.Close theChannelprotected voiddoConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress)Deprecated.Connect to the remote peer using the given localAddress if one is specified ornullotherwise.protected voiddoDisconnect()Deprecated.Disconnect thisChannelfrom its remote peerprotected intdoReadBytes(ByteBuf buf)Deprecated.Read bytes from the underlying Socket.protected voiddoShutdownOutput()Deprecated.Called when conditions justify shutting down the output portion of the channel.booleanisActive()Deprecated.Returntrueif theChannelis active and so connected.booleanisInputShutdown()Deprecated.Determine if the input side of this channel is shutdown.booleanisOpen()Deprecated.Returnstrueif theChannelis open and may get active laterbooleanisOutputShutdown()Deprecated.booleanisShutdown()Deprecated.Determine if both the input and output of this channel have been shutdown.java.net.InetSocketAddresslocalAddress()Deprecated.Returns the local address where this channel is bound to.protected java.net.SocketAddresslocalAddress0()Deprecated.Returns theSocketAddresswhich is bound locally.ServerSocketChannelparent()Deprecated.Returns the parent of this channel.java.net.InetSocketAddressremoteAddress()Deprecated.Returns the remote address where this channel is connected to.protected java.net.SocketAddressremoteAddress0()Deprecated.Return theSocketAddresswhich theChannelis connected to.protected voidsetReadPending(boolean readPending)Deprecated.ChannelFutureshutdown()Deprecated.Will shutdown the input and output sides of this channel.ChannelFutureshutdown(ChannelPromise promise)Deprecated.Will shutdown the input and output sides of this channel.ChannelFutureshutdownInput()Deprecated.Shutdown the input side of this channel.ChannelFutureshutdownInput(ChannelPromise promise)Deprecated.Will shutdown the input and notifyChannelPromise.ChannelFutureshutdownOutput()Deprecated.ChannelFutureshutdownOutput(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- theSocketwhich 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 parentChannelwhich was used to create this instance. This can be null if the has no parent as it was created by your self.socket- theSocketwhich is used by this instance
-
-
Method Detail
-
parent
public ServerSocketChannel parent()
Deprecated.Description copied from interface:ChannelReturns the parent of this channel.- Specified by:
parentin interfaceChannel- Specified by:
parentin interfaceSocketChannel- Overrides:
parentin classAbstractChannel- Returns:
- the parent channel.
nullif this channel does not have a parent channel.
-
config
public OioSocketChannelConfig config()
Deprecated.Description copied from interface:ChannelReturns the configuration of this channel.- Specified by:
configin interfaceChannel- Specified by:
configin interfaceSocketChannel
-
isOpen
public boolean isOpen()
Deprecated.Description copied from interface:ChannelReturnstrueif theChannelis open and may get active later
-
isActive
public boolean isActive()
Deprecated.Description copied from interface:ChannelReturntrueif theChannelis active and so connected.- Specified by:
isActivein interfaceChannel- Overrides:
isActivein classOioByteStreamChannel
-
isOutputShutdown
public boolean isOutputShutdown()
Deprecated.- Specified by:
isOutputShutdownin interfaceDuplexChannel- See Also:
Socket.isOutputShutdown()
-
isInputShutdown
public boolean isInputShutdown()
Deprecated.Description copied from class:AbstractOioByteChannelDetermine if the input side of this channel is shutdown.- Specified by:
isInputShutdownin interfaceDuplexChannel- Specified by:
isInputShutdownin classAbstractOioByteChannel- Returns:
trueif the input side of this channel is shutdown.
-
isShutdown
public boolean isShutdown()
Deprecated.Description copied from interface:DuplexChannelDetermine if both the input and output of this channel have been shutdown.- Specified by:
isShutdownin interfaceDuplexChannel
-
doShutdownOutput
protected final void doShutdownOutput() throws java.lang.ExceptionDeprecated.Description copied from class:AbstractChannelCalled when conditions justify shutting down the output portion of the channel. This may happen if a write operation throws an exception.- Overrides:
doShutdownOutputin classAbstractChannel- Throws:
java.lang.Exception
-
shutdownOutput
public ChannelFuture shutdownOutput()
Deprecated.- Specified by:
shutdownOutputin interfaceDuplexChannel- See Also:
Socket.shutdownOutput()
-
shutdownInput
public ChannelFuture shutdownInput()
Deprecated.Description copied from class:AbstractOioByteChannelShutdown the input side of this channel.- Specified by:
shutdownInputin interfaceDuplexChannel- Specified by:
shutdownInputin 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:DuplexChannelWill shutdown the input and output sides of this channel.- Specified by:
shutdownin 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:AbstractOioByteChannelRead bytes from the underlying Socket.- Overrides:
doReadBytesin classOioByteStreamChannel- Parameters:
buf- theByteBufinto 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:DuplexChannelWill shutdown the output and notifyChannelPromise.- Specified by:
shutdownOutputin interfaceDuplexChannel- See Also:
Socket.shutdownOutput()
-
shutdownInput
public ChannelFuture shutdownInput(ChannelPromise promise)
Deprecated.Description copied from interface:DuplexChannelWill shutdown the input and notifyChannelPromise.- Specified by:
shutdownInputin interfaceDuplexChannel- See Also:
Socket.shutdownInput()
-
shutdown
public ChannelFuture shutdown(ChannelPromise promise)
Deprecated.Description copied from interface:DuplexChannelWill shutdown the input and output sides of this channel.- Specified by:
shutdownin 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:ChannelReturns the local address where this channel is bound to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
localAddressin interfaceChannel- Specified by:
localAddressin interfaceSocketChannel- Overrides:
localAddressin classAbstractChannel- Returns:
- the local address of this channel.
nullif this channel is not bound.
-
remoteAddress
public java.net.InetSocketAddress remoteAddress()
Deprecated.Description copied from interface:ChannelReturns the remote address where this channel is connected to. The returnedSocketAddressis supposed to be down-cast into more concrete type such asInetSocketAddressto retrieve the detailed information.- Specified by:
remoteAddressin interfaceChannel- Specified by:
remoteAddressin interfaceSocketChannel- Overrides:
remoteAddressin classAbstractChannel- Returns:
- the remote address of this channel.
nullif 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:AbstractChannelReturns theSocketAddresswhich is bound locally.- Specified by:
localAddress0in classAbstractChannel
-
remoteAddress0
protected java.net.SocketAddress remoteAddress0()
Deprecated.Description copied from class:AbstractChannelReturn theSocketAddresswhich theChannelis connected to.- Specified by:
remoteAddress0in classAbstractChannel
-
doBind
protected void doBind(java.net.SocketAddress localAddress) throws java.lang.ExceptionDeprecated.Description copied from class:AbstractChannelBind theChannelto theSocketAddress- Specified by:
doBindin classAbstractChannel- Throws:
java.lang.Exception
-
doConnect
protected void doConnect(java.net.SocketAddress remoteAddress, java.net.SocketAddress localAddress) throws java.lang.ExceptionDeprecated.Description copied from class:AbstractOioChannelConnect to the remote peer using the given localAddress if one is specified ornullotherwise.- Specified by:
doConnectin classAbstractOioChannel- Throws:
java.lang.Exception
-
doDisconnect
protected void doDisconnect() throws java.lang.ExceptionDeprecated.Description copied from class:AbstractChannelDisconnect thisChannelfrom its remote peer- Specified by:
doDisconnectin classAbstractChannel- Throws:
java.lang.Exception
-
doClose
protected void doClose() throws java.lang.ExceptionDeprecated.Description copied from class:AbstractChannelClose theChannel- Overrides:
doClosein classOioByteStreamChannel- Throws:
java.lang.Exception
-
checkInputShutdown
protected boolean checkInputShutdown()
Deprecated.
-
setReadPending
@Deprecated protected void setReadPending(boolean readPending)
Deprecated.- Overrides:
setReadPendingin classAbstractOioChannel
-
-