|
|
@ -13,6 +13,7 @@ |
|
|
|
package tech.pegasys.pantheon.ethereum.p2p.netty; |
|
|
|
package tech.pegasys.pantheon.ethereum.p2p.netty; |
|
|
|
|
|
|
|
|
|
|
|
import tech.pegasys.pantheon.ethereum.p2p.api.PeerConnection; |
|
|
|
import tech.pegasys.pantheon.ethereum.p2p.api.PeerConnection; |
|
|
|
|
|
|
|
import tech.pegasys.pantheon.ethereum.p2p.api.PeerConnection.PeerNotConnected; |
|
|
|
import tech.pegasys.pantheon.ethereum.p2p.wire.messages.DisconnectMessage.DisconnectReason; |
|
|
|
import tech.pegasys.pantheon.ethereum.p2p.wire.messages.DisconnectMessage.DisconnectReason; |
|
|
|
import tech.pegasys.pantheon.ethereum.p2p.wire.messages.PingMessage; |
|
|
|
import tech.pegasys.pantheon.ethereum.p2p.wire.messages.PingMessage; |
|
|
|
|
|
|
|
|
|
|
@ -54,8 +55,12 @@ final class WireKeepAlive extends ChannelDuplexHandler { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
LOG.debug("Idle connection detected, sending Wire PING to peer."); |
|
|
|
LOG.debug("Idle connection detected, sending Wire PING to peer."); |
|
|
|
connection.send(null, PingMessage.get()); |
|
|
|
connection.send(null, PingMessage.get()); |
|
|
|
waitingForPong.set(true); |
|
|
|
waitingForPong.set(true); |
|
|
|
|
|
|
|
} catch (final PeerNotConnected ignored) { |
|
|
|
|
|
|
|
LOG.trace("PING not sent because peer is already disconnected"); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|