线程池未完全关闭就去关闭Selector会出现关闭异常,通过ExecutorService.awaitTermination(long timeout, TimeUnit unit)等待终止完成后,再去关闭Selector。