public void destroy() {
        
        if (!stopped) {
            try {
                worker.join();
            } catch (InterruptedException e) {
            }
            
            try {
                selector.close();
            } catch (IOException e) {
            }
        }
    }