From 9fde27bfcd7cfaa056d73459316aabde1fcb7ce7 Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Tue, 7 Jun 2011 01:29:55 -0400 Subject: [PATCH] Fixed IPv6 support in NetworkManager. --- src/main/java/net/minecraft/server/NetworkManager.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java index f32ec79929..230f7a15f1 100644 --- a/src/main/java/net/minecraft/server/NetworkManager.java +++ b/src/main/java/net/minecraft/server/NetworkManager.java @@ -10,6 +10,9 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; +// CraftBukkit +import java.net.SocketException; + public class NetworkManager { public static final Object a = new Object(); @@ -43,11 +46,16 @@ public class NetworkManager { this.i = socket.getRemoteSocketAddress(); this.p = nethandler; + // CraftBukkit start - IPv6 stack in Java on BSD/OSX doesn't support setTrafficClass try { - socket.setSoTimeout(30000); socket.setTrafficClass(24); + } catch (SocketException e) { + } + // CraftBukkit end + try { // CraftBukkit start - cant compile these outside the try + socket.setSoTimeout(30000); this.input = new DataInputStream(socket.getInputStream()); this.output = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream(), 5120)); // CraftBukkit end