@Override
        public void run() {
                try {
                        try {
                                input = new ObjectInputStream(connection.getSocket().getInputStream());
                        } catch (IOException ioe) {
                                connection.sendMessage(new SocketDisconnectedMessage(connection, DisconnectCause.IO_ERROR));
                                return;
                        }
                        DisconnectCause disconnectCause = DisconnectCause.OTHER;
                        while (true) {
                                Object o = null;
                                try {
                                        o = input.readObject();
                                } catch (ClassNotFoundException cnfe) {
                                        continue;
                                } catch (SocketTimeoutException ste) {
                                        disconnectCause = DisconnectCause.READ_TIMEOUT;
                                        break;
                                } catch (IOException ioe) {
                                        disconnectCause = DisconnectCause.IO_ERROR;
                                        break;
                                }
                                connection.sendMessage(new PacketReceivedMessage(o, connection));
                        }
                        try { input.close(); } catch (IOException ioe) {}
                        input = null;
                        connection.sendMessage(new SocketDisconnectedMessage(connection, disconnectCause));
                } catch (Exception e) {
                        e.printStackTrace();
                }
        }