Class StreamReceiver
java.lang.Object
com.xpdustry.claj.common.net.stream.StreamReceiver
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static arc.struct.IntMap<StreamBuilder> static final intprotected static arc.struct.IntMap<arc.struct.IntMap<StreamBuilder>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanhas()static booleanhas(arc.net.Connection connection) static Packetreceived(arc.net.Connection connection, StreamPacket packet) Server stream builders.static Packetreceived(StreamPacket packet) Client stream builders.static voidreset()Clears client stream builders.static voidreset(arc.net.Connection connection) Removes server stream builders of a connection (or all if null).
-
Field Details
-
MAX_STREAMS
public static final int MAX_STREAMS- See Also:
-
sbuilders
-
cbuilders
-
-
Constructor Details
-
StreamReceiver
public StreamReceiver()
-
-
Method Details
-
received
Client stream builders.- Returns:
nulluntil a stream is complete.- Throws:
RuntimeException- if a chunk was received before his head.
-
received
Server stream builders.- Returns:
nulluntil 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.
-