@Override
    public void run() {
        currentThread = Thread.currentThread();
        for (; ; ) {
            if (currentThread.isInterrupted()) {
                System.out.println("Finished transfer thread");
                return;
            }
            try {
                Response response = commandTasksQueue.poll(DELAY_TIME, TimeUnit.MILLISECONDS);
                if (null != response) {
                    processResponse(response);
                }

            } catch (InterruptedException e) {
                // Restore the interrupted status
                Thread.currentThread().interrupt();
            } catch (IOException e) {
                closeQuietly(clientSocketProcessor);
            }

        }
    }