Package io.netty.channel.local
Class LocalServerChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
io.netty.channel.AbstractServerChannel
io.netty.channel.local.LocalServerChannel
- All Implemented Interfaces:
Channel
,ChannelOutboundInvoker
,ServerChannel
,AttributeMap
,Comparable<Channel>
A
ServerChannel
for the local transport which allows in VM communication.-
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
FieldsModifier and TypeFieldDescriptionprivate boolean
private final ChannelConfig
private LocalAddress
private final Runnable
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconfig()
Returns the configuration of this channel.protected void
Schedule a read operation.protected void
doBind
(SocketAddress localAddress) Bind theChannel
to theSocketAddress
protected void
doClose()
Close theChannel
protected void
protected void
boolean
isActive()
Returntrue
if theChannel
is active and so connected.protected boolean
isCompatible
(EventLoop loop) Returntrue
if the givenEventLoop
is compatible with this instance.boolean
isOpen()
Returnstrue
if theChannel
is open and may get active laterReturns the local address where this channel is bound to.protected SocketAddress
Returns theSocketAddress
which is bound locally.protected LocalChannel
newLocalChannel
(LocalChannel peer) A factory method forLocalChannel
s.private void
Returns the remote address where this channel is connected to.(package private) LocalChannel
serve
(LocalChannel peer) private void
serve0
(LocalChannel child) Methods inherited from class io.netty.channel.AbstractServerChannel
doDisconnect, doWrite, filterOutboundMessage, metadata, newUnsafe, remoteAddress0
Methods inherited from class io.netty.channel.AbstractChannel
alloc, bind, bind, bytesBeforeUnwritable, bytesBeforeWritable, close, close, closeFuture, compareTo, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, doShutdownOutput, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, parent, pipeline, read, toString, unsafe, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlush
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, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isRegistered, isWritable, parent, pipeline, read, unsafe
Methods inherited from interface io.netty.channel.ChannelOutboundInvoker
bind, bind, close, close, connect, connect, connect, connect, deregister, deregister, disconnect, disconnect, newFailedFuture, newProgressivePromise, newPromise, newSucceededFuture, voidPromise, write, write, writeAndFlush, writeAndFlush
Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
config
-
inboundBuffer
-
shutdownHook
-
state
private volatile int state -
localAddress
-
acceptInProgress
private volatile boolean acceptInProgress
-
-
Constructor Details
-
LocalServerChannel
public LocalServerChannel()
-
-
Method Details
-
config
Description copied from interface:Channel
Returns the configuration of this channel. -
localAddress
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
- Overrides:
localAddress
in classAbstractChannel
- Returns:
- the local address of this channel.
null
if this channel is not bound.
-
remoteAddress
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
- Overrides:
remoteAddress
in classAbstractServerChannel
- 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
.
-
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. -
isCompatible
Description copied from class:AbstractChannel
Returntrue
if the givenEventLoop
is compatible with this instance.- Specified by:
isCompatible
in classAbstractChannel
-
localAddress0
Description copied from class:AbstractChannel
Returns theSocketAddress
which is bound locally.- Specified by:
localAddress0
in classAbstractChannel
-
doRegister
Description copied from class:AbstractChannel
Is called after theChannel
is registered with itsEventLoop
as part of the register process. Sub-classes may override this method- Overrides:
doRegister
in classAbstractChannel
- Throws:
Exception
-
doBind
Description copied from class:AbstractChannel
Bind theChannel
to theSocketAddress
- Specified by:
doBind
in classAbstractChannel
- Throws:
Exception
-
doClose
Description copied from class:AbstractChannel
Close theChannel
- Specified by:
doClose
in classAbstractChannel
- Throws:
Exception
-
doDeregister
Description copied from class:AbstractChannel
- Overrides:
doDeregister
in classAbstractChannel
- Throws:
Exception
-
doBeginRead
Description copied from class:AbstractChannel
Schedule a read operation.- Specified by:
doBeginRead
in classAbstractChannel
- Throws:
Exception
-
serve
-
readInbound
private void readInbound() -
newLocalChannel
A factory method forLocalChannel
s. Users may override it to create custom instances ofLocalChannel
s. -
serve0
-