Manually set nodelay so we can ignore errors

This commit is contained in:
md_5 2013-09-01 18:23:51 +10:00
parent f99330b2ae
commit 5026435e9a

View File

@ -1,4 +1,4 @@
From 147b1c393ad343fe4f3449ed7c61ee9430947587 Mon Sep 17 00:00:00 2001
From ca578c41828399b4afcf18296186814d213d1958 Mon Sep 17 00:00:00 2001
From: md_5 <md_5@live.com.au>
Date: Tue, 2 Jul 2013 09:06:29 +1000
Subject: [PATCH] Netty
@ -160,7 +160,7 @@ index c9e187e..b433c60 100644
this.b = true;
} catch (Exception exception) {
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 8499c7f..e5a09b3 100644
index a9db856..7c39d34 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -6,6 +6,8 @@ import java.io.IOException;
@ -688,10 +688,10 @@ index 0000000..7dc16ac
+}
diff --git a/src/main/java/org/spigotmc/netty/NettyServerConnection.java b/src/main/java/org/spigotmc/netty/NettyServerConnection.java
new file mode 100644
index 0000000..8a82352
index 0000000..7e5671d
--- /dev/null
+++ b/src/main/java/org/spigotmc/netty/NettyServerConnection.java
@@ -0,0 +1,170 @@
@@ -0,0 +1,177 @@
+package org.spigotmc.netty;
+
+import com.google.common.util.concurrent.ThreadFactoryBuilder;
@ -792,6 +792,13 @@ index 0000000..8a82352
+ {
+ // IP_TOS is not supported (Windows XP / Windows Server 2003)
+ }
+ try
+ {
+ ch.config().setOption( ChannelOption.TCP_NODELAY, false );
+ } catch ( ChannelException ex )
+ {
+ // TCP_NODELAY is not supported (Mac)
+ }
+
+ NettyNetworkManager networkManager = new NettyNetworkManager();
+ ch.pipeline()
@ -799,7 +806,7 @@ index 0000000..8a82352
+ .addLast( "decoder", new PacketDecoder() )
+ .addLast( "manager", networkManager );
+ }
+ } ).childOption( ChannelOption.TCP_NODELAY, false ).group( group ).localAddress( host, port ).bind().syncUninterruptibly();
+ } ).group( group ).localAddress( host, port ).bind().syncUninterruptibly();
+ }
+
+ /**