Top Description Fields Constructors Methods
io.netty5.channel.local

public Class LocalServerChannel

extends AbstractServerChannel<LocalChannel, LocalAddress, LocalAddress>
implements LocalChannelUnsafe
Class Inheritance
All Implemented Interfaces
io.netty5.channel.local.LocalChannelUnsafe
Imports
io.netty5.buffer.DefaultBufferAllocators, io.netty5.channel.AbstractServerChannel, .ChannelOption, .EventLoop, .EventLoopGroup, .ServerChannel, java.net.SocketAddress, java.util.ArrayDeque, .Queue

A ServerChannel for the local transport which allows in VM communication.

Field Summary

Modifier and TypeField and Description
private volatile boolean
private final Queue<Object>
private volatile LocalAddress
private volatile int

Constructor Summary

AccessConstructor and Description
public
LocalServerChannel(EventLoop eventLoop, EventLoopGroup childEventLoopGroup)

Method Summary

Modifier and TypeMethod and Description
public void
public void
protected void
doBind(SocketAddress
the SocketAddress to bound to.
localAddress
)

Implements abstract io.netty5.channel.AbstractChannel.doBind.

Bind the Channel to the SocketAddress
protected void
protected void
doRead(boolean
true if a read was already pending when read() was called.
wasReadPendingAlready
)

Implements abstract io.netty5.channel.AbstractChannel.doRead.

Schedule a read operation.
protected boolean
doReadNow(AbstractChannel<LocalChannel, LocalAddress, LocalAddress>.ReadSink
the ReadSink that should be called with messages that are read from the transport to propagate these.
readSink
)

Implements abstract io.netty5.channel.AbstractChannel.doReadNow.

Try to read a message from the transport and dispatch it via ReadSink#processRead(int, int, Object).
public boolean
isActive()

Implements io.netty5.channel.Channel.isActive.

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

Implements io.netty5.channel.Channel.isOpen.

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

Implements abstract io.netty5.channel.AbstractChannel.localAddress0.

Returns the SocketAddress which is bound locally.
protected LocalChannel
newLocalChannel(LocalChannel peer)

A factory method for LocalChannels.

public void
pack-priv LocalChannel
serve(final LocalChannel peer)

private void
serve0(final LocalChannel child)

Inherited from io.netty5.channel.AbstractServerChannel:
childEventLoopGroupdoConnectdoDisconnectdoFinishConnectdoShutdowndoWriteNowfilterOutboundMessageisShutdownremoteAddress0

Field Detail

acceptInProgressback to summary
private volatile boolean acceptInProgress
inboundBufferback to summary
private final Queue<Object> inboundBuffer
localAddressback to summary
private volatile LocalAddress localAddress

Hides io.netty5.channel.AbstractChannel.localAddress.

stateback to summary
private volatile int state

Constructor Detail

LocalServerChannelback to summary
public LocalServerChannel(EventLoop eventLoop, EventLoopGroup childEventLoopGroup)

Method Detail

closeTransportNowback to summary
public void closeTransportNow()

Implements io.netty5.channel.local.LocalChannelUnsafe.closeTransportNow.

Annotations
@Override
deregisterTransportNowback to summary
public void deregisterTransportNow()

Implements io.netty5.channel.local.LocalChannelUnsafe.deregisterTransportNow.

Annotations
@Override
doBindback to summary
protected void doBind(SocketAddress localAddress) throws Exception

Implements abstract io.netty5.channel.AbstractChannel.doBind.

Doc from io.netty5.channel.AbstractChannel.doBind.

Bind the Channel to the SocketAddress

Parameters
localAddress:SocketAddress

the SocketAddress to bound to.

Annotations
@Override
Exceptions
Exception:
when an error happens.
doCloseback to summary
protected void doClose() throws Exception

Implements abstract io.netty5.channel.AbstractChannel.doClose.

Doc from io.netty5.channel.AbstractChannel.doClose.

Close the Channel

Annotations
@Override
Exceptions
Exception:
thrown on error.
doReadback to summary
protected void doRead(boolean wasReadPendingAlready) throws Exception

Implements abstract io.netty5.channel.AbstractChannel.doRead.

Doc from io.netty5.channel.AbstractChannel.doRead.

Schedule a read operation.

Parameters
wasReadPendingAlready:boolean

true if a read was already pending when read() was called.

Annotations
@Override
Exceptions
Exception:
thrown on error.
doReadNowback to summary
protected boolean doReadNow(AbstractChannel<LocalChannel, LocalAddress, LocalAddress>.ReadSink readSink)

Implements abstract io.netty5.channel.AbstractChannel.doReadNow.

Doc from io.netty5.channel.AbstractChannel.doReadNow.

Try to read a message from the transport and dispatch it via ReadSink#processRead(int, int, Object). This method is called in a loop until there is nothing more messages to read or the channel was shutdown / closed. This method should never be called directly by sub-classes, use readNow() instead.

Parameters
readSink:AbstractChannel<LocalChannel, LocalAddress, LocalAddress>.ReadSink

the ReadSink that should be called with messages that are read from the transport to propagate these.

Returns:boolean

true if the channel should be shutdown / closed.

Annotations
@Override
isActiveback to summary
public boolean isActive()

Implements io.netty5.channel.Channel.isActive.

Doc from io.netty5.channel.Channel.isActive.

Return true if the Channel is active and so connected.

Annotations
@Override
isOpenback to summary
public boolean isOpen()

Implements io.netty5.channel.Channel.isOpen.

Doc from io.netty5.channel.Channel.isOpen.

Returns true if the Channel is open and may get active later

Annotations
@Override
localAddress0back to summary
protected LocalAddress localAddress0()

Implements abstract io.netty5.channel.AbstractChannel.localAddress0.

Doc from io.netty5.channel.AbstractChannel.localAddress0.

Returns the SocketAddress which is bound locally.

Returns:LocalAddress

the local address if any, null otherwise.

Annotations
@Override
newLocalChannelback to summary
protected LocalChannel newLocalChannel(LocalChannel peer)

A factory method for LocalChannels. Users may override it to create custom instances of LocalChannels.

registerTransportNowback to summary
public void registerTransportNow()

Implements io.netty5.channel.local.LocalChannelUnsafe.registerTransportNow.

Annotations
@Override
serveback to summary
pack-priv LocalChannel serve(final LocalChannel peer)
serve0back to summary
private void serve0(final LocalChannel child)