@Override
    public void run() {
        run = true;
        while (run) {
            try {
                server.listen();
            } catch (SocketException e) {
                LOGGER.log(Level.INFO, "ServerSocket has been closed. ListenThread will now terminate");
                run = false;
            } catch (TimeoutException e) {
                LOGGER.log(Level.SEVERE, "New SocketThread failed to start in time. TimeoutException details", e);
            } catch (NullException e) {
                LOGGER.log(Level.SEVERE, "server.listen_thread is null, cannot run listen. ListenThread will terminate");
                run = false;
            } catch (IOException e) {
                LOGGER.log(Level.SEVERE, "Failed to accept new connection. ListenThread will now terminate", e);
                run = false;
            } catch (FeatureNotUsedException e) {
                LOGGER.log(Level.SEVERE, "server.state is not set to LISTEN. ListenThread will terminate", e);
                run = false;
            }
        }
        LOGGER.log(Level.INFO, "Listen loop has exited on port {0}", port);
        try {
            this.close();
        } catch (ServerSocketCloseException e) {
            LOGGER.log(Level.SEVERE, "Failed to close and interrupt ListenThread. Thread may not have terminated correctly and could be tieing up system resources", e);
        }
    }