[#1503]Fix a bug which incorrectly canceled keys for DatagramPackets when the epoll workaround was used

This commit is contained in:
Norman Maurer 2013-07-22 11:46:56 +02:00
parent 5aeb836d8e
commit 0cfbb7d54b

View File

@ -213,7 +213,7 @@ abstract class AbstractNioSelector implements NioSelector {
for (SelectionKey key: selector.keys()) {
SelectableChannel ch = key.channel();
try {
if (ch instanceof DatagramChannel && !((DatagramChannel) ch).isConnected() ||
if (ch instanceof DatagramChannel && !ch.isOpen() ||
ch instanceof SocketChannel && !((SocketChannel) ch).isConnected()) {
notConnected = true;
// cancel the key just to be on the safe side