Class NetListenerEvent

java.lang.Object
com.xpdustry.claj.server.util.NetListenerEvent
All Implemented Interfaces:
arc.util.pooling.Pool.Poolable, Runnable

public class NetListenerEvent extends Object implements Runnable, arc.util.pooling.Pool.Poolable
Poolable class to delay packet decoding and event running to another thread.
  • Field Details

    • pool

      protected static final com.xpdustry.claj.common.util.Pool<NetListenerEvent> pool
      Having a big pool can help at high load
    • type

      protected byte type
      -1: invalid, 0: connected, 1: disconnected, 2: received raw, 3: received, 4: idle.
    • connection

      protected arc.net.Connection connection
    • reason

      protected arc.net.DcReason reason
    • buffer

      protected ByteBuffer buffer
    • object

      protected Object object
    • listener

      protected arc.net.NetListener listener
    • serializer

      protected arc.net.NetSerializer serializer
    • reset

      protected boolean reset
  • Constructor Details

    • NetListenerEvent

      public NetListenerEvent()
  • Method Details

    • run

      public void run()
      Specified by:
      run in interface Runnable
    • reset

      public void reset()
      Specified by:
      reset in interface arc.util.pooling.Pool.Poolable
    • get

      protected static NetListenerEvent get(int type, arc.net.Connection connection, arc.net.DcReason reason, ByteBuffer buffer, Object object, arc.net.NetListener listener, arc.net.NetSerializer serializer)
    • ofConnected

      public static NetListenerEvent ofConnected(arc.net.Connection connection, arc.net.NetListener listener)
    • ofDisconnected

      public static NetListenerEvent ofDisconnected(arc.net.Connection connection, arc.net.NetListener listener, arc.net.DcReason reason)
    • ofReceived

      public static NetListenerEvent ofReceived(arc.net.Connection connection, arc.net.NetListener listener, ByteBuffer buffer, arc.net.NetSerializer serializer)
    • ofReceived

      public static NetListenerEvent ofReceived(arc.net.Connection connection, arc.net.NetListener listener, Object object)
    • ofIdle

      public static NetListenerEvent ofIdle(arc.net.Connection connection, arc.net.NetListener listener)