mirror of https://github.com/grpc/grpc-java.git
core: scheduler.schedule() can be used normally
Since netty 4.1.11-final, netty/netty#6627 has been fixed.
This commit is contained in:
parent
17af756df4
commit
1594ebbc12
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue