Skip to content
Snippets Groups Projects
Commit baee7183 authored by Michael Eischer's avatar Michael Eischer
Browse files

network: Properly fix FAKE_WAN_DELAY timer initialization

The REFITNetworkEndpointWorker is already prepared to delay the
execution of some initialization code until it is called by its
scheduler. Thus, just use this mechanism.
parent a3155ff7
No related branches found
No related tags found
No related merge requests found
......@@ -60,9 +60,7 @@ public class REFITNetworkEndpointWorker extends REFITSchedulerTask {
if (address.nodeID != nodeID) {
throw new IllegalArgumentException("Got connection for wrong node!");
}
if (REFITConfig.FAKE_WAN_DELAYS) {
timer = newTimer(this::timeout);
}
this.timer = null;
this.address = address;
try {
connection.init(socketChannel);
......@@ -112,6 +110,9 @@ public class REFITNetworkEndpointWorker extends REFITSchedulerTask {
// register() should only be called from the thread that owns the selector
// otherwise registering a selectionKey may deadlock
connection.register(this);
if (REFITConfig.FAKE_WAN_DELAYS) {
timer = newTimer(this::timeout);
}
initCalled = false;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment