Package dev.pulsemc.pulse.api.network
Interface NetworkBuffer
public interface NetworkBuffer
Manages the outbound packet buffer for a player's network connection.
Pulse uses a batching system to reduce system call overhead and optimize network performance. This interface provides direct control over the buffering process, allowing plugins to monitor the current buffer size and force-send packets when latency is a priority.
-
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Flushes the packet buffer for the player.longGets the total number of bytes currently waiting in the outbound buffer.
-
Method Details
-
flush
void flush()Flushes the packet buffer for the player. All currently queued packets will be sent to the network immediately. Use this if your plugin sends latency-sensitive data that should not wait for the next tick. -
getPendingBytes
long getPendingBytes()Gets the total number of bytes currently waiting in the outbound buffer. This value represents the raw serialized size of all queued packets.- Returns:
- the amount of pending data in bytes
-