mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-08 17:37:42 +01:00
Increase socket size, cache direct buffers
This commit is contained in:
parent
7ba8189a28
commit
aa2a6522dc
@ -18,7 +18,7 @@ public final class Server {
|
|||||||
public static final Logger LOGGER = LoggerFactory.getLogger(Server.class);
|
public static final Logger LOGGER = LoggerFactory.getLogger(Server.class);
|
||||||
public static final int WORKER_COUNT = Integer.getInteger("minestom.workers",
|
public static final int WORKER_COUNT = Integer.getInteger("minestom.workers",
|
||||||
Runtime.getRuntime().availableProcessors() * 2);
|
Runtime.getRuntime().availableProcessors() * 2);
|
||||||
public static final int SOCKET_BUFFER_SIZE = Integer.getInteger("minestom.buffer-size", 65535);
|
public static final int SOCKET_BUFFER_SIZE = Integer.getInteger("minestom.buffer-size", 262_143);
|
||||||
public static final int MAX_PACKET_SIZE = 2_097_151; // 3 bytes var-int
|
public static final int MAX_PACKET_SIZE = 2_097_151; // 3 bytes var-int
|
||||||
public static final boolean NO_DELAY = true;
|
public static final boolean NO_DELAY = true;
|
||||||
|
|
||||||
|
@ -191,6 +191,6 @@ public final class PacketUtils {
|
|||||||
|
|
||||||
public static ByteBuffer allocateTrimmedPacket(@NotNull ServerPacket packet) {
|
public static ByteBuffer allocateTrimmedPacket(@NotNull ServerPacket packet) {
|
||||||
final var temp = PacketUtils.createFramedPacket(packet);
|
final var temp = PacketUtils.createFramedPacket(packet);
|
||||||
return ByteBuffer.allocate(temp.position()).put(temp.flip());
|
return ByteBuffer.allocateDirect(temp.position()).put(temp.flip());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user