Interface ConnectionHandle


public interface ConnectionHandle
Stable handle for one native connection.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the exact runtime adapter identifier.
    Returns this connection's serialized event loop.
    void
    Flushes pending outbound writes.
    long
    id()
    Returns the sanitized connection identifier.
    Returns the currently observed inbound phase.
    boolean
    Reports whether the native connection remains open.
    Returns the currently observed outbound phase.
    void
    receive(Object nativePacket)
    Injects an already-decoded native serverbound packet through NativePackets listeners.
    void
    receiveSilently(Object nativePacket)
    Injects an already-decoded native serverbound packet after NativePackets listeners.
    void
    send(Object nativePacket)
    Writes a native clientbound packet and flushes the connection.
    void
    sendSilently(Object nativePacket)
    Writes and flushes while bypassing only NativePackets listeners.
    void
    write(Object nativePacket)
    Writes a native clientbound packet without forcing a flush.
    void
    writeSilently(Object nativePacket)
    Writes without flushing while bypassing only NativePackets listeners.
  • Method Details

    • id

      long id()
      Returns the sanitized connection identifier.
      Returns:
      connection identifier
    • adapterId

      String adapterId()
      Returns the exact runtime adapter identifier.
      Returns:
      adapter identifier
    • inboundPhase

      ProtocolPhase inboundPhase()
      Returns the currently observed inbound phase.
      Returns:
      inbound phase
    • outboundPhase

      ProtocolPhase outboundPhase()
      Returns the currently observed outbound phase.
      Returns:
      outbound phase
    • send

      void send(Object nativePacket)
      Writes a native clientbound packet and flushes the connection.
    • sendSilently

      void sendSilently(Object nativePacket)
      Writes and flushes while bypassing only NativePackets listeners.
    • write

      void write(Object nativePacket)
      Writes a native clientbound packet without forcing a flush.
    • writeSilently

      void writeSilently(Object nativePacket)
      Writes without flushing while bypassing only NativePackets listeners.
    • flush

      void flush()
      Flushes pending outbound writes.
    • receive

      void receive(Object nativePacket)
      Injects an already-decoded native serverbound packet through NativePackets listeners.
    • receiveSilently

      void receiveSilently(Object nativePacket)
      Injects an already-decoded native serverbound packet after NativePackets listeners.
    • isOpen

      boolean isOpen()
      Reports whether the native connection remains open.
      Returns:
      whether the connection is open
    • eventLoop

      EventLoopHandle eventLoop()
      Returns this connection's serialized event loop.
      Returns:
      event-loop handle