mirror of
https://github.com/Minestom/Minestom.git
synced 2024-10-05 01:48:39 +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) {
|
protected void initChannel(@NotNull SocketChannel ch) {
|
||||||
ChannelConfig config = ch.config();
|
ChannelConfig config = ch.config();
|
||||||
config.setOption(ChannelOption.TCP_NODELAY, true);
|
config.setOption(ChannelOption.TCP_NODELAY, true);
|
||||||
|
config.setOption(ChannelOption.SO_SNDBUF, 1_000_000);
|
||||||
|
|
||||||
ChannelPipeline pipeline = ch.pipeline();
|
ChannelPipeline pipeline = ch.pipeline();
|
||||||
|
|
||||||
|
@ -101,9 +101,9 @@ public class NettyPlayerConnection extends PlayerConnection {
|
|||||||
public void sendPacket(@NotNull ServerPacket serverPacket) {
|
public void sendPacket(@NotNull ServerPacket serverPacket) {
|
||||||
if (shouldSendPacket(serverPacket)) {
|
if (shouldSendPacket(serverPacket)) {
|
||||||
if (getPlayer() != null) {
|
if (getPlayer() != null) {
|
||||||
channel.write(serverPacket); // Flush on player update
|
this.channel.write(serverPacket); // Flush on player update
|
||||||
} else {
|
} else {
|
||||||
channel.writeAndFlush(serverPacket);
|
this.channel.writeAndFlush(serverPacket);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user