core: scheduler.schedule() can be used normally

Since netty 4.1.11-final, netty/netty#6627 has been fixed.
This commit is contained in:
ZHANG Dapeng 2017-06-09 14:28:32 -07:00 committed by GitHub
parent 17af756df4
commit 1594ebbc12
1 changed files with 2 additions and 4 deletions

View File

@ -73,8 +73,7 @@ public class KeepAliveManager {
// We have received some data. Reschedule the ping with the new time. // We have received some data. Reschedule the ping with the new time.
pingFuture = scheduler.schedule( pingFuture = scheduler.schedule(
sendPing, sendPing,
// normalized as some Netty executor service does not accept a negative delay nextKeepaliveTime - ticker.read(),
Math.max(nextKeepaliveTime - ticker.read(), 0L),
TimeUnit.NANOSECONDS); TimeUnit.NANOSECONDS);
state = State.PING_SCHEDULED; state = State.PING_SCHEDULED;
} }
@ -186,8 +185,7 @@ public class KeepAliveManager {
state = State.PING_SCHEDULED; state = State.PING_SCHEDULED;
pingFuture = scheduler.schedule( pingFuture = scheduler.schedule(
sendPing, sendPing,
// normalized as some Netty executor service does not accept a negative delay nextKeepaliveTime - ticker.read(),
Math.max(nextKeepaliveTime - ticker.read(), 0L),
TimeUnit.NANOSECONDS); TimeUnit.NANOSECONDS);
} else if (state == State.IDLE_AND_PING_SENT) { } else if (state == State.IDLE_AND_PING_SENT) {
state = State.PING_SENT; state = State.PING_SENT;