- java.lang.Object
-
- io.netty5.util.DefaultAttributeMap
-
- io.netty5.channel.AbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
-
- io.netty5.channel.local.LocalChannel
-
- All Implemented Interfaces:
Channel,ChannelOutboundInvoker,IoHandle,AttributeMap,FuturePromiseFactory,Comparable<Channel>
public class LocalChannel extends AbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
AChannelfor the local transport.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.netty5.channel.AbstractChannel
AbstractChannel.DefaultAbstractChannelPipeline
-
-
Constructor Summary
Constructors Modifier Constructor Description LocalChannel(EventLoop eventLoop)protectedLocalChannel(LocalServerChannel parent, EventLoop eventLoop, LocalChannel peer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseTransportNow()voidderegisterTransportNow()protected voiddoBeginRead()Schedule a read operation.protected voiddoBind(SocketAddress localAddress)Bind theChannelto theSocketAddressprotected voiddoClose()Close theChannelprotected booleandoConnect(SocketAddress remoteAddress, SocketAddress localAddress)Connect to remote peer.protected voiddoDisconnect()Disconnect thisChannelfrom its remote peerprotected booleandoFinishConnect(LocalAddress requestedRemoteAddress)Finish a connect request.protected voiddoShutdown(ChannelShutdownDirection direction)Shutdown one direction of theChannel.protected voiddoWrite(ChannelOutboundBuffer in)Flush the content of the given buffer to the remote peer.booleanisActive()Returntrueif theChannelis active and so connected.booleanisOpen()Returnstrueif theChannelis open and may get active laterbooleanisShutdown(ChannelShutdownDirection direction)protected LocalAddresslocalAddress0()Returns theSocketAddresswhich is bound locally.voidregisterTransportNow()protected LocalAddressremoteAddress0()Return theSocketAddresswhich theChannelis connected to.-
Methods inherited from class io.netty5.channel.AbstractChannel
annotateConnectException, assertEventLoop, autoReadCleared, bufferAllocator, cacheAddresses, closeForciblyTransport, closeFuture, closeIfClosed, closeTransport, compareTo, deregisterTransport, ensureOpen, equals, executor, filterOutboundMessage, finishConnect, fireChannelActiveIfNotActiveBefore, getExtendedOption, getMaxMessagesPerWrite, getOption, getWriteSpinCount, handleWriteError, hashCode, id, isAllowHalfClosure, isAutoRead, isConnectPending, isExtendedOptionSupported, isOptionSupported, isRegistered, localAddress, metadata, newChannelPipeline, newSupportedIdentityOptionsSet, outboundBuffer, parent, pipeline, prepareToClose, readIfIsAutoRead, recvBufAllocHandle, remoteAddress, runAfterTransportAction, safeSetFailure, safeSetSuccess, setBufferAllocator, setExtendedOption, setOption, shutdownTransport, toString, validate, validateEventLoopGroup, validateFileRegion, writableBytes, writeFlushed
-
Methods inherited from class io.netty5.util.DefaultAttributeMap
attr, hasAttr
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty5.util.AttributeMap
attr, hasAttr
-
Methods inherited from interface io.netty5.channel.Channel
bind, close, connect, connect, deregister, disconnect, flush, isWritable, read, register, sendOutboundEvent, shutdown, write, writeAndFlush
-
Methods inherited from interface io.netty5.channel.ChannelOutboundInvoker
newFailedFuture, newPromise, newSucceededFuture, newSucceededFuture
-
-
-
-
Constructor Detail
-
LocalChannel
public LocalChannel(EventLoop eventLoop)
-
LocalChannel
protected LocalChannel(LocalServerChannel parent, EventLoop eventLoop, LocalChannel peer)
-
-
Method Detail
-
isOpen
public boolean isOpen()
Description copied from interface:ChannelReturnstrueif theChannelis open and may get active later
-
isActive
public boolean isActive()
Description copied from interface:ChannelReturntrueif theChannelis active and so connected.
-
localAddress0
protected LocalAddress localAddress0()
Description copied from class:AbstractChannelReturns theSocketAddresswhich is bound locally.- Specified by:
localAddress0in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
-
remoteAddress0
protected LocalAddress remoteAddress0()
Description copied from class:AbstractChannelReturn theSocketAddresswhich theChannelis connected to.- Specified by:
remoteAddress0in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
-
doBind
protected void doBind(SocketAddress localAddress) throws Exception
Description copied from class:AbstractChannelBind theChannelto theSocketAddress- Specified by:
doBindin classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>- Throws:
Exception
-
doShutdown
protected void doShutdown(ChannelShutdownDirection direction)
Description copied from class:AbstractChannelShutdown one direction of theChannel.- Specified by:
doShutdownin classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>- Parameters:
direction- the direction to shutdown.
-
isShutdown
public boolean isShutdown(ChannelShutdownDirection direction)
Description copied from interface:Channel- Specified by:
isShutdownin interfaceChannel
-
doDisconnect
protected void doDisconnect() throws ExceptionDescription copied from class:AbstractChannelDisconnect thisChannelfrom its remote peer- Specified by:
doDisconnectin classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>- Throws:
Exception
-
doClose
protected void doClose() throws ExceptionDescription copied from class:AbstractChannelClose theChannel- Specified by:
doClosein classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>- Throws:
Exception
-
doBeginRead
protected void doBeginRead() throws ExceptionDescription copied from class:AbstractChannelSchedule a read operation.- Specified by:
doBeginReadin classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>- Throws:
Exception
-
doWrite
protected void doWrite(ChannelOutboundBuffer in) throws Exception
Description copied from class:AbstractChannelFlush the content of the given buffer to the remote peer.- Specified by:
doWritein classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>- Throws:
Exception
-
doConnect
protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception
Description copied from class:AbstractChannelConnect to remote peer.- Specified by:
doConnectin classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>- Parameters:
remoteAddress- the address of the remote peer.localAddress- the local address of this channel.- Returns:
trueif the connect was completed,falseifAbstractChannel.finishConnect()will be called later again to try finishing the connect.- Throws:
Exception- thrown on error.
-
doFinishConnect
protected boolean doFinishConnect(LocalAddress requestedRemoteAddress) throws Exception
Description copied from class:AbstractChannelFinish a connect request.- Specified by:
doFinishConnectin classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>- Parameters:
requestedRemoteAddress- the remote address of the peer.- Returns:
trueif the connect was completed,falseifAbstractChannel.finishConnect()will be called later again to try finishing the connect.- Throws:
Exception- thrown on error.
-
registerTransportNow
public void registerTransportNow()
-
deregisterTransportNow
public void deregisterTransportNow()
-
closeTransportNow
public void closeTransportNow()
-
-