mirror of
https://github.com/Minestom/Minestom.git
synced 2024-10-03 00:47:28 +02:00
Increase socket send buffer to 1MB
This commit is contained in:
parent
c1e623eddc
commit
099a8bafdc
@ -65,6 +65,7 @@ public class NettyServer {
|
||||
protected void initChannel(@NotNull SocketChannel ch) {
|
||||
ChannelConfig config = ch.config();
|
||||
config.setOption(ChannelOption.TCP_NODELAY, true);
|
||||
config.setOption(ChannelOption.SO_SNDBUF, 1_000_000);
|
||||
|
||||
ChannelPipeline pipeline = ch.pipeline();
|
||||
|
||||
|
@ -101,9 +101,9 @@ public class NettyPlayerConnection extends PlayerConnection {
|
||||
public void sendPacket(@NotNull ServerPacket serverPacket) {
|
||||
if (shouldSendPacket(serverPacket)) {
|
||||
if (getPlayer() != null) {
|
||||
channel.write(serverPacket); // Flush on player update
|
||||
this.channel.write(serverPacket); // Flush on player update
|
||||
} else {
|
||||
channel.writeAndFlush(serverPacket);
|
||||
this.channel.writeAndFlush(serverPacket);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user