- 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>
AChannel
for 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)
protected
LocalChannel(LocalServerChannel parent, EventLoop eventLoop, LocalChannel peer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeTransportNow()
void
deregisterTransportNow()
protected void
doBeginRead()
Schedule a read operation.protected void
doBind(SocketAddress localAddress)
Bind theChannel
to theSocketAddress
protected void
doClose()
Close theChannel
protected boolean
doConnect(SocketAddress remoteAddress, SocketAddress localAddress)
Connect to remote peer.protected void
doDisconnect()
Disconnect thisChannel
from its remote peerprotected boolean
doFinishConnect(LocalAddress requestedRemoteAddress)
Finish a connect request.protected void
doShutdown(ChannelShutdownDirection direction)
Shutdown one direction of theChannel
.protected void
doWrite(ChannelOutboundBuffer in)
Flush the content of the given buffer to the remote peer.boolean
isActive()
Returntrue
if theChannel
is active and so connected.boolean
isOpen()
Returnstrue
if theChannel
is open and may get active laterboolean
isShutdown(ChannelShutdownDirection direction)
protected LocalAddress
localAddress0()
Returns theSocketAddress
which is bound locally.void
registerTransportNow()
protected LocalAddress
remoteAddress0()
Return theSocketAddress
which theChannel
is 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:Channel
Returnstrue
if theChannel
is open and may get active later
-
isActive
public boolean isActive()
Description copied from interface:Channel
Returntrue
if theChannel
is active and so connected.
-
localAddress0
protected LocalAddress localAddress0()
Description copied from class:AbstractChannel
Returns theSocketAddress
which is bound locally.- Specified by:
localAddress0
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
-
remoteAddress0
protected LocalAddress remoteAddress0()
Description copied from class:AbstractChannel
Return theSocketAddress
which theChannel
is connected to.- Specified by:
remoteAddress0
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
-
doBind
protected void doBind(SocketAddress localAddress) throws Exception
Description copied from class:AbstractChannel
Bind theChannel
to theSocketAddress
- Specified by:
doBind
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
- Throws:
Exception
-
doShutdown
protected void doShutdown(ChannelShutdownDirection direction)
Description copied from class:AbstractChannel
Shutdown one direction of theChannel
.- Specified by:
doShutdown
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
- Parameters:
direction
- the direction to shutdown.
-
isShutdown
public boolean isShutdown(ChannelShutdownDirection direction)
Description copied from interface:Channel
- Specified by:
isShutdown
in interfaceChannel
-
doDisconnect
protected void doDisconnect() throws Exception
Description copied from class:AbstractChannel
Disconnect thisChannel
from its remote peer- Specified by:
doDisconnect
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
- Throws:
Exception
-
doClose
protected void doClose() throws Exception
Description copied from class:AbstractChannel
Close theChannel
- Specified by:
doClose
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
- Throws:
Exception
-
doBeginRead
protected void doBeginRead() throws Exception
Description copied from class:AbstractChannel
Schedule a read operation.- Specified by:
doBeginRead
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
- Throws:
Exception
-
doWrite
protected void doWrite(ChannelOutboundBuffer in) throws Exception
Description copied from class:AbstractChannel
Flush the content of the given buffer to the remote peer.- Specified by:
doWrite
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
- Throws:
Exception
-
doConnect
protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception
Description copied from class:AbstractChannel
Connect to remote peer.- Specified by:
doConnect
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
- Parameters:
remoteAddress
- the address of the remote peer.localAddress
- the local address of this channel.- Returns:
true
if the connect was completed,false
ifAbstractChannel.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:AbstractChannel
Finish a connect request.- Specified by:
doFinishConnect
in classAbstractChannel<LocalServerChannel,LocalAddress,LocalAddress>
- Parameters:
requestedRemoteAddress
- the remote address of the peer.- Returns:
true
if the connect was completed,false
ifAbstractChannel.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()
-
-