Simply discard input events that occur when the thread pool has been shutdown (during connection closure)

This commit is contained in:
Cameron Gutman 2013-12-20 15:12:35 -05:00
parent a1440621f9
commit ed92f9d28e

View File

@ -47,7 +47,8 @@ public class NvConnection {
this.listener = listener;
this.config = config;
this.threadPool = new ThreadPoolExecutor(1, 1, Long.MAX_VALUE, TimeUnit.DAYS, new LinkedBlockingQueue<Runnable>());
this.threadPool = new ThreadPoolExecutor(1, 1, Long.MAX_VALUE, TimeUnit.DAYS,
new LinkedBlockingQueue<Runnable>(), new ThreadPoolExecutor.DiscardPolicy());
}
public static String getMacAddressString() throws SocketException {