@Override
        public void run() {

            //Go on while run is true
            while(run.get()) {
                try {
                    TFTPPacket packet = packetQueue.take();

                    if(packet instanceof WRQPacket){
                        sendFile((WRQPacket) packet);
                    }else if(packet instanceof RRQPacket){
                        receiveFile((RRQPacket) packet);
                    }

                } catch (Exception e) {
                    fireExceptionOccurred(TFTPClient.this, e);
                }
            }

            socket.close();
        }