Class NetherNetChannel

java.lang.Object
io.netty.util.DefaultAttributeMap
io.netty.channel.AbstractChannel
org.cloudburstmc.netty.channel.nethernet.NetherNetChannel
All Implemented Interfaces:
io.netty.channel.Channel, io.netty.channel.ChannelOutboundInvoker, io.netty.util.AttributeMap, Comparable<io.netty.channel.Channel>
Direct Known Subclasses:
NetherNetChildChannel, NetherNetClientChannel

public abstract class NetherNetChannel extends io.netty.channel.AbstractChannel
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final record 
    One side of the selected pair carries the address the socket uses and the candidate type it was gathered as: host, srflx, prflx or relay.

    Nested classes/interfaces inherited from class io.netty.channel.AbstractChannel

    io.netty.channel.AbstractChannel.AbstractUnsafe

    Nested classes/interfaces inherited from interface io.netty.channel.Channel

    io.netty.channel.Channel.Unsafe
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected SocketAddress
     
    protected static final io.netty.channel.ChannelMetadata
     
    protected boolean
     
    protected tel.schich.libdatachannel.PeerConnection
     
    protected final Queue<Object>
     
    protected tel.schich.libdatachannel.DataChannel
     
    protected SocketAddress
     
    protected tel.schich.libdatachannel.DataChannel
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    NetherNetChannel(io.netty.channel.Channel parent, InetSocketAddress remote, InetSocketAddress local)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Closes the data channels and peer connection, dropping their listeners first.
    io.netty.channel.ChannelConfig
     
    protected void
     
    protected void
    doBind(SocketAddress localAddress)
     
    protected void
     
    protected void
     
    protected void
     
    protected void
     
    protected void
    doWrite(io.netty.channel.ChannelOutboundBuffer in)
     
    long
    The round trip time of the underlying transport in milliseconds, or 0 while it is unknown, which matches how the raknet transport reports a session without a completed ping.
    boolean
     
    protected boolean
    isCompatible(io.netty.channel.EventLoop loop)
     
    boolean
     
    protected SocketAddress
     
    io.netty.channel.ChannelMetadata
     
    protected SocketAddress
     
    int
    The largest message the remote accepts on a data channel, or 0 while unknown.
    The ICE candidate pair traffic currently flows over, or null until the peer connection is connected.
    void
    setDataChannels(tel.schich.libdatachannel.DataChannel reliable, tel.schich.libdatachannel.DataChannel unreliable)
     
    void
     

    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, filterOutboundMessage, flush, hashCode, id, invalidateLocalAddress, invalidateRemoteAddress, isRegistered, isWritable, localAddress, maxMessagesPerWrite, newChannelPipeline, newFailedFuture, newId, newProgressivePromise, newPromise, newSucceededFuture, newUnsafe, parent, pipeline, read, remoteAddress, 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
  • Field Details

    • METADATA

      protected static final io.netty.channel.ChannelMetadata METADATA
    • config

      protected DefaultNetherChannelConfig config
    • peerConnection

      protected volatile tel.schich.libdatachannel.PeerConnection peerConnection
    • remoteAddress

      protected volatile SocketAddress remoteAddress
    • localAddress

      protected volatile SocketAddress localAddress
    • reliableChannel

      protected tel.schich.libdatachannel.DataChannel reliableChannel
    • unreliableChannel

      protected tel.schich.libdatachannel.DataChannel unreliableChannel
    • pendingWrites

      protected final Queue<Object> pendingWrites
    • open

      protected volatile boolean open
  • Constructor Details

  • Method Details

    • getPing

      public long getPing()
      The round trip time of the underlying transport in milliseconds, or 0 while it is unknown, which matches how the raknet transport reports a session without a completed ping.
      Returns:
      the round trip time in milliseconds
    • selectedPath

      public NetherNetChannel.Path selectedPath()
      The ICE candidate pair traffic currently flows over, or null until the peer connection is connected. The pair can change after connection, so callers should not cache it.

      Candidate types come from the descriptions rather than the native selected pair, whose Java binding only carries addresses. A relay type on either side means the traffic passes through a TURN server.

    • remoteMaxMessageSize

      public int remoteMaxMessageSize()
      The largest message the remote accepts on a data channel, or 0 while unknown. Larger batches are segmented before they are sent.
    • setDataChannels

      public void setDataChannels(tel.schich.libdatachannel.DataChannel reliable, tel.schich.libdatachannel.DataChannel unreliable)
    • doWrite

      protected void doWrite(io.netty.channel.ChannelOutboundBuffer in) throws Exception
      Specified by:
      doWrite in class io.netty.channel.AbstractChannel
      Throws:
      Exception
    • doRegister

      protected void doRegister() throws Exception
      Overrides:
      doRegister in class io.netty.channel.AbstractChannel
      Throws:
      Exception
    • doDeregister

      protected void doDeregister() throws Exception
      Overrides:
      doDeregister in class io.netty.channel.AbstractChannel
      Throws:
      Exception
    • doBind

      protected void doBind(SocketAddress localAddress) throws Exception
      Specified by:
      doBind in class io.netty.channel.AbstractChannel
      Throws:
      Exception
    • doDisconnect

      protected void doDisconnect() throws Exception
      Specified by:
      doDisconnect in class io.netty.channel.AbstractChannel
      Throws:
      Exception
    • doClose

      protected void doClose() throws Exception
      Specified by:
      doClose in class io.netty.channel.AbstractChannel
      Throws:
      Exception
    • closeWebRTC

      protected void closeWebRTC()
      Closes the data channels and peer connection, dropping their listeners first.
    • doBeginRead

      protected void doBeginRead() throws Exception
      Specified by:
      doBeginRead in class io.netty.channel.AbstractChannel
      Throws:
      Exception
    • isCompatible

      protected boolean isCompatible(io.netty.channel.EventLoop loop)
      Specified by:
      isCompatible in class io.netty.channel.AbstractChannel
    • localAddress0

      protected SocketAddress localAddress0()
      Specified by:
      localAddress0 in class io.netty.channel.AbstractChannel
    • remoteAddress0

      protected SocketAddress remoteAddress0()
      Specified by:
      remoteAddress0 in class io.netty.channel.AbstractChannel
    • config

      public io.netty.channel.ChannelConfig config()
    • isOpen

      public boolean isOpen()
    • isActive

      public boolean isActive()
    • metadata

      public io.netty.channel.ChannelMetadata metadata()
    • setRemoteAddress

      public void setRemoteAddress(SocketAddress remoteAddress)