summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorWesley Wolfe <weswolf@aol.com>2012-08-08 06:54:28 -0500
committerWesley Wolfe <weswolf@aol.com>2012-08-08 07:00:41 -0500
commita16e0b6323eb58a58a8b859b3af6891876598da9 (patch)
treed201ec24ed42823bf5291210c793a84ec32143fd /src/main/java
parent25fe93479f6fdd20a1ea2c22605eed16a7be7075 (diff)
downloadcraftbukkit-a16e0b6323eb58a58a8b859b3af6891876598da9.tar
craftbukkit-a16e0b6323eb58a58a8b859b3af6891876598da9.tar.gz
craftbukkit-a16e0b6323eb58a58a8b859b3af6891876598da9.tar.lz
craftbukkit-a16e0b6323eb58a58a8b859b3af6891876598da9.tar.xz
craftbukkit-a16e0b6323eb58a58a8b859b3af6891876598da9.zip
Change socket traffic class try-catch. Fixes BUKKIT-2093
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/NetLoginHandler.java2
-rw-r--r--src/main/java/net/minecraft/server/NetworkManager.java11
2 files changed, 4 insertions, 9 deletions
diff --git a/src/main/java/net/minecraft/server/NetLoginHandler.java b/src/main/java/net/minecraft/server/NetLoginHandler.java
index fc4c8c66..7c201a84 100644
--- a/src/main/java/net/minecraft/server/NetLoginHandler.java
+++ b/src/main/java/net/minecraft/server/NetLoginHandler.java
@@ -24,7 +24,7 @@ public class NetLoginHandler extends NetHandler {
private SecretKey k = null;
public String hostname = ""; // CraftBukkit - add field
- public NetLoginHandler(MinecraftServer minecraftserver, Socket socket, String s) {
+ public NetLoginHandler(MinecraftServer minecraftserver, Socket socket, String s) throws java.io.IOException { // CraftBukkit - throws IOException
this.server = minecraftserver;
this.networkManager = new NetworkManager(socket, s, this, minecraftserver.E().getPrivate());
this.networkManager.e = 0;
diff --git a/src/main/java/net/minecraft/server/NetworkManager.java b/src/main/java/net/minecraft/server/NetworkManager.java
index 21cd9f2a..fed8a225 100644
--- a/src/main/java/net/minecraft/server/NetworkManager.java
+++ b/src/main/java/net/minecraft/server/NetworkManager.java
@@ -5,6 +5,7 @@ import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.net.Socket;
import java.net.SocketAddress;
+import java.net.SocketException;
import java.security.PrivateKey;
import java.util.ArrayList;
import java.util.Collections;
@@ -46,7 +47,7 @@ public class NetworkManager implements INetworkManager {
private PrivateKey A = null;
private int lowPriorityQueueDelay = 50;
- public NetworkManager(Socket socket, String s, NetHandler nethandler, PrivateKey privatekey) {
+ public NetworkManager(Socket socket, String s, NetHandler nethandler, PrivateKey privatekey) throws IOException { // CraftBukkit - throws IOException
this.A = privatekey;
this.socket = socket;
this.j = socket.getRemoteSocketAddress();
@@ -55,18 +56,12 @@ public class NetworkManager implements INetworkManager {
try {
socket.setSoTimeout(30000);
socket.setTrafficClass(24);
- // CraftBukkit start - initialize these in try-catch
- this.input = new DataInputStream(socket.getInputStream());
- this.output = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream(), 5120));
- } catch (IOException socketexception) {
- // CraftBukkit end
+ } catch (SocketException socketexception) {
System.err.println(socketexception.getMessage());
}
- /* CraftBukkit start - moved up
this.input = new DataInputStream(socket.getInputStream());
this.output = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream(), 5120));
- // CraftBukkit end */
this.u = new NetworkReaderThread(this, s + " read thread");
this.t = new NetworkWriterThread(this, s + " write thread");
this.u.start();