Package org.drasyl.channel.rs
Class RustDrasylChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
org.drasyl.channel.rs.RustDrasylChannel
- All Implemented Interfaces:
io.netty.channel.Channel,io.netty.channel.ChannelOutboundInvoker,io.netty.util.AttributeMap,Comparable<io.netty.channel.Channel>,DrasylChannel,IdentityChannel
@UnstableApi
public class RustDrasylChannel
extends io.netty.channel.AbstractChannel
implements DrasylChannel
A virtual
Channel for peer communication.
(Currently) only compatible with NioEventLoop.
Inspired by LocalChannel.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class io.netty.channel.AbstractChannel
io.netty.channel.AbstractChannel.AbstractUnsafeNested classes/interfaces inherited from interface io.netty.channel.Channel
io.netty.channel.Channel.Unsafe -
Method Summary
Modifier and TypeMethodDescriptionio.netty.channel.ChannelConfigconfig()protected voidprotected voiddoBind(SocketAddress localAddress) protected voiddoClose()protected voidprotected voidprotected voiddoWrite(io.netty.channel.ChannelOutboundBuffer in) protected ObjectvoidThis method start processing (if any) queued inbound messages.identity()booleanisActive()protected booleanisCompatible(io.netty.channel.EventLoop loop) booleanbooleanisOpen()booleanReturnstrueif and only if the total number of pending bytes exceed the read watermark of this channel.protected SocketAddressio.netty.channel.ChannelMetadatametadata()protected io.netty.channel.AbstractChannel.AbstractUnsafeparent()voidqueueRead(io.netty.buffer.ByteBuf msg) This method places the messageoin the queue for inbound messages to be read by this channel.unsafe()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, doDeregister, doShutdownOutput, equals, eventLoop, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, pipeline, read, remoteAddress, toString, validateFileRegion, voidPromise, write, write, writeAndFlush, writeAndFlushMethods inherited from class io.netty.util.DefaultAttributeMap
attr, hasAttrMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.netty.util.AttributeMap
attr, hasAttrMethods inherited from interface io.netty.channel.Channel
alloc, bytesBeforeUnwritable, bytesBeforeWritable, closeFuture, eventLoop, flush, id, isRegistered, isWritable, localAddress, pipeline, read, remoteAddressMethods 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, writeAndFlushMethods inherited from interface java.lang.Comparable
compareTo
-
Method Details
-
isDirectPathPresent
public boolean isDirectPathPresent() -
newUnsafe
protected io.netty.channel.AbstractChannel.AbstractUnsafe newUnsafe()- Specified by:
newUnsafein classio.netty.channel.AbstractChannel
-
isCompatible
protected boolean isCompatible(io.netty.channel.EventLoop loop) - Specified by:
isCompatiblein classio.netty.channel.AbstractChannel
-
identity
- Specified by:
identityin interfaceIdentityChannel
-
localAddress0
- Specified by:
localAddress0in classio.netty.channel.AbstractChannel
-
remoteAddress0
- Specified by:
remoteAddress0in classio.netty.channel.AbstractChannel
-
doRegister
protected void doRegister()- Overrides:
doRegisterin classio.netty.channel.AbstractChannel
-
doBind
- Specified by:
doBindin classio.netty.channel.AbstractChannel
-
doDisconnect
protected void doDisconnect()- Specified by:
doDisconnectin classio.netty.channel.AbstractChannel
-
doClose
protected void doClose()- Specified by:
doClosein classio.netty.channel.AbstractChannel
-
doBeginRead
protected void doBeginRead()- Specified by:
doBeginReadin classio.netty.channel.AbstractChannel
-
unsafe
- Specified by:
unsafein interfaceio.netty.channel.Channel- Overrides:
unsafein classio.netty.channel.AbstractChannel
-
queueRead
public void queueRead(io.netty.buffer.ByteBuf msg) This method places the messageoin the queue for inbound messages to be read by this channel. Queued messages are not processed untilfinishRead()is called. -
finishRead
public void finishRead()This method start processing (if any) queued inbound messages. This method ensures that read/write order is respected. Therefore, if channel is currently writing, these writes are performed first and the reads are performed afterwards. -
parent
- Specified by:
parentin interfaceio.netty.channel.Channel- Specified by:
parentin interfaceDrasylChannel- Overrides:
parentin classio.netty.channel.AbstractChannel
-
doWrite
- Specified by:
doWritein classio.netty.channel.AbstractChannel- Throws:
Exception
-
filterOutboundMessage
- Overrides:
filterOutboundMessagein classio.netty.channel.AbstractChannel- Throws:
Exception
-
config
public io.netty.channel.ChannelConfig config()- Specified by:
configin interfaceio.netty.channel.Channel
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceio.netty.channel.Channel
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceio.netty.channel.Channel
-
metadata
public io.netty.channel.ChannelMetadata metadata()- Specified by:
metadatain interfaceio.netty.channel.Channel
-
isReadBufferFull
public boolean isReadBufferFull()Returnstrueif and only if the total number of pending bytes exceed the read watermark of this channel.
-