Minor improvements for logging and debugging
This commit is contained in:
parent
e5c956c6e5
commit
2ae1e561d8
@ -38,7 +38,7 @@ public class TTL {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static long validate(long ttl) {
|
private static long validate(long ttl) {
|
||||||
if (ttl < 0 || ttl > 28 * DAY) throw new IllegalArgumentException("TTL must be between 1 and 28 days");
|
if (ttl < 0 || ttl > 28 * DAY) throw new IllegalArgumentException("TTL must be between 0 seconds and 28 days");
|
||||||
return ttl;
|
return ttl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -254,7 +254,7 @@ public class NioNetworkHandler implements NetworkHandler, InternalContext.Contex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (CancelledKeyException e) {
|
} catch (CancelledKeyException e) {
|
||||||
LOG.error(e.getMessage(), e);
|
LOG.debug(e.getMessage(), e);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// handle read/write
|
// handle read/write
|
||||||
@ -287,11 +287,15 @@ public class NioNetworkHandler implements NetworkHandler, InternalContext.Contex
|
|||||||
}
|
}
|
||||||
// set interest ops
|
// set interest ops
|
||||||
for (Map.Entry<ConnectionInfo, SelectionKey> e : connections.entrySet()) {
|
for (Map.Entry<ConnectionInfo, SelectionKey> e : connections.entrySet()) {
|
||||||
if (e.getValue().isValid()
|
try {
|
||||||
&& (e.getValue().interestOps() & OP_WRITE) == 0
|
if (e.getValue().isValid()
|
||||||
&& (e.getValue().interestOps() & OP_CONNECT) == 0
|
&& (e.getValue().interestOps() & OP_WRITE) == 0
|
||||||
&& !e.getKey().getSendingQueue().isEmpty()) {
|
&& (e.getValue().interestOps() & OP_CONNECT) == 0
|
||||||
e.getValue().interestOps(OP_READ | OP_WRITE);
|
&& !e.getKey().getSendingQueue().isEmpty()) {
|
||||||
|
e.getValue().interestOps(OP_READ | OP_WRITE);
|
||||||
|
}
|
||||||
|
} catch (CancelledKeyException x) {
|
||||||
|
e.getKey().disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// start new connections
|
// start new connections
|
||||||
|
Loading…
Reference in New Issue
Block a user