public void runRecv(){
        DataInputStream inputStream;
        try {
            inputStream = new DataInputStream(socket.getInputStream());
        } catch (IOException e) {
            LOG.severe("Could not get inputstream! " + e.getMessage());
            return;
        }
        while(!Thread.interrupted()){
            try {
                short packetID = inputStream.readShort();
                int dataLength = inputStream.readInt();
                byte[] data = new byte[dataLength];
                inputStream.readFully(data);
                handler.queueForHandle(protocol.unpackPacket(socket.getRemoteSocketAddress(), packetID, (data)));
            } catch (EOFException e){
                LOG.info("Connection with " + ((InetSocketAddress)socket.getRemoteSocketAddress()).getHostString() + " closed by remote host!") ;
                Thread.currentThread().interrupt();
            } catch (IOException e) {
                LOG.severe("Error while reading packet! " + e.getMessage());
            }
        }
        try {
            sendThread.interrupt();
            socket.close();
        } catch (IOException e) {
            LOG.severe("Error while closing socket! " + e.getMessage());
        }
    }