Class StreamReceiver

java.lang.Object
com.xpdustry.claj.common.net.stream.StreamReceiver

public class StreamReceiver extends Object
  • Field Details

    • MAX_STREAMS

      public static final int MAX_STREAMS
      See Also:
    • sbuilders

      protected static arc.struct.IntMap<arc.struct.IntMap<StreamBuilder>> sbuilders
    • cbuilders

      protected static arc.struct.IntMap<StreamBuilder> cbuilders
  • Constructor Details

    • StreamReceiver

      public StreamReceiver()
  • Method Details

    • received

      public static Packet received(StreamPacket packet)
      Client stream builders.
      Returns:
      null until a stream is complete.
      Throws:
      RuntimeException - if a chunk was received before his head.
    • received

      public static Packet received(arc.net.Connection connection, StreamPacket packet)
      Server stream builders.
      Returns:
      null until a stream is complete.
      Throws:
      RuntimeException - if a chunk was received before his head.
    • reset

      public static void reset()
      Clears client stream builders.
    • reset

      public static void reset(arc.net.Connection connection)
      Removes server stream builders of a connection (or all if null). Must be called at disconnect.
    • has

      public static boolean has()
      Returns:
      whether a client builder is in progress or not.
    • has

      public static boolean has(arc.net.Connection connection)
      Returns:
      whether a server builder is present for the specified connection (or any if null) or not.