@Override
    public void run() {
        for(;;) {
            if( Thread.currentThread().isInterrupted() ) {
                System.out.println("response receiver interrupted");
                return;
            }
            try {
                Response response = responseReader.read();
                if( response instanceof Answer ) {
                    answers.put((Answer) response);
                } else if( response instanceof Event ) {
                    Event event = (Event) response;
                    EventProcessor eventProcessor = handlerFactory.getEventProcessor(event);
                    eventProcessor.processEvent(event);
                } else {
                    // todo unknown response type
                }

            } catch (IOException e) {
                // e.printStackTrace();
                for( ReceiverErrorHandler errorHandler : errorHandlerList ) {
                    errorHandler.processError(e);
                }
                Thread.currentThread().interrupt();


            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        }
    }