mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-14 19:25:51 +00:00
PeerGroup: fix naming of vPingTimer
This commit is contained in:
parent
5b78601b4a
commit
34d804ecca
@ -102,7 +102,7 @@ public class PeerGroup extends AbstractIdleService implements TransactionBroadca
|
|||||||
|
|
||||||
// Runs a background thread that we use for scheduling pings to our peers, so we can measure their performance
|
// Runs a background thread that we use for scheduling pings to our peers, so we can measure their performance
|
||||||
// and network latency. We ping peers every pingIntervalMsec milliseconds.
|
// and network latency. We ping peers every pingIntervalMsec milliseconds.
|
||||||
private volatile Timer pingTimer;
|
private volatile Timer vPingTimer;
|
||||||
/** How many milliseconds to wait after receiving a pong before sending another ping. */
|
/** How many milliseconds to wait after receiving a pong before sending another ping. */
|
||||||
public static final long DEFAULT_PING_INTERVAL_MSEC = 2000;
|
public static final long DEFAULT_PING_INTERVAL_MSEC = 2000;
|
||||||
private long pingIntervalMsec = DEFAULT_PING_INTERVAL_MSEC;
|
private long pingIntervalMsec = DEFAULT_PING_INTERVAL_MSEC;
|
||||||
@ -560,7 +560,7 @@ public class PeerGroup extends AbstractIdleService implements TransactionBroadca
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception {
|
protected void startUp() throws Exception {
|
||||||
// This is run in a background thread by the AbstractIdleService implementation.
|
// This is run in a background thread by the AbstractIdleService implementation.
|
||||||
pingTimer = new Timer("Peer pinging thread", true);
|
vPingTimer = new Timer("Peer pinging thread", true);
|
||||||
// Bring up the requested number of connections. If a connect attempt fails,
|
// Bring up the requested number of connections. If a connect attempt fails,
|
||||||
// new peers will be tried until there is a success, so just calling connectToAnyPeer for the wanted number
|
// new peers will be tried until there is a success, so just calling connectToAnyPeer for the wanted number
|
||||||
// of peers is sufficient.
|
// of peers is sufficient.
|
||||||
@ -577,7 +577,7 @@ public class PeerGroup extends AbstractIdleService implements TransactionBroadca
|
|||||||
@Override
|
@Override
|
||||||
protected void shutDown() throws Exception {
|
protected void shutDown() throws Exception {
|
||||||
// This is run on a separate thread by the AbstractIdleService implementation.
|
// This is run on a separate thread by the AbstractIdleService implementation.
|
||||||
pingTimer.cancel();
|
vPingTimer.cancel();
|
||||||
// Blocking close of all sockets. TODO: there is a race condition here, for the solution see:
|
// Blocking close of all sockets. TODO: there is a race condition here, for the solution see:
|
||||||
// http://biasedbit.com/netty-releaseexternalresources-hangs/
|
// http://biasedbit.com/netty-releaseexternalresources-hangs/
|
||||||
channels.close().await();
|
channels.close().await();
|
||||||
@ -875,7 +875,7 @@ public class PeerGroup extends AbstractIdleService implements TransactionBroadca
|
|||||||
final long interval = getPingIntervalMsec();
|
final long interval = getPingIntervalMsec();
|
||||||
if (interval <= 0)
|
if (interval <= 0)
|
||||||
return; // Disabled.
|
return; // Disabled.
|
||||||
pingTimer.schedule(new TimerTask() {
|
vPingTimer.schedule(new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user