Package org.drasyl.channel
Class DrasylChannel
java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
org.drasyl.channel.DrasylChannel
- All Implemented Interfaces:
io.netty.channel.Channel,io.netty.channel.ChannelOutboundInvoker,io.netty.util.AttributeMap,Comparable<io.netty.channel.Channel>
public class DrasylChannel
extends io.netty.channel.AbstractChannel
A virtual
Channel for peer communication.
(Currently) only compatible with NioEventLoop.
Inspired by LocalChannel.
- See Also:
-
Nested Class Summary
Nested 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 -
Constructor Summary
ConstructorsConstructorDescriptionDrasylChannel(io.netty.channel.Channel parent, org.drasyl.channel.DrasylChannel.State state, DrasylAddress localAddress, DrasylAddress remoteAddress) DrasylChannel(DrasylServerChannel parent, DrasylAddress remoteAddress) -
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 ObjectbooleanisActive()protected booleanisCompatible(io.netty.channel.EventLoop loop) booleanReturnstrueif remote peer is reachable via a direct path.booleanisOpen()protected SocketAddressio.netty.channel.ChannelMetadatametadata()protected io.netty.channel.AbstractChannel.AbstractUnsafeprotected SocketAddressMethods 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, parent, pipeline, read, remoteAddress, toString, unsafe, 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, hasAttr
-
Constructor Details
-
DrasylChannel
public DrasylChannel(io.netty.channel.Channel parent, org.drasyl.channel.DrasylChannel.State state, DrasylAddress localAddress, DrasylAddress remoteAddress) -
DrasylChannel
-
-
Method Details
-
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
-
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
-
filterOutboundMessage
- Overrides:
filterOutboundMessagein classio.netty.channel.AbstractChannel- Throws:
Exception
-
doWrite
- Specified by:
doWritein classio.netty.channel.AbstractChannel- Throws:
Exception
-
config
public io.netty.channel.ChannelConfig config() -
isOpen
public boolean isOpen() -
isActive
public boolean isActive() -
metadata
public io.netty.channel.ChannelMetadata metadata() -
isDirectPathPresent
public boolean isDirectPathPresent()Returnstrueif remote peer is reachable via a direct path.- Returns:
trueif remote peer is reachable via a direct path.
-