projects
/
ldk-java
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop dup PeerManager tiemr_tick_occurred calls from NioPeerHandler
[ldk-java]
/
src
/
main
/
java
/
org
/
ldk
/
batteries
/
NioPeerHandler.java
diff --git
a/src/main/java/org/ldk/batteries/NioPeerHandler.java
b/src/main/java/org/ldk/batteries/NioPeerHandler.java
index 991a6b135fda62468aa3878b1864cf4b1f512fe9..faca477f599d284539385af23c0d09bde2987b0f 100644
(file)
--- a/
src/main/java/org/ldk/batteries/NioPeerHandler.java
+++ b/
src/main/java/org/ldk/batteries/NioPeerHandler.java
@@
-98,7
+98,6
@@
public class NioPeerHandler {
/**
* Constructs a new peer handler, spawning a thread to monitor for socket events.
/**
* Constructs a new peer handler, spawning a thread to monitor for socket events.
- * The background thread will call the PeerManager's timer_tick_occured() function for you on an appropriate schedule.
*
* @param manager The LDK PeerManager which connection data will be provided to.
* @throws IOException If an internal java.nio error occurs.
*
* @param manager The LDK PeerManager which connection data will be provided to.
* @throws IOException If an internal java.nio error occurs.
@@
-108,7
+107,6
@@
public class NioPeerHandler {
this.selector = Selector.open();
io_thread = new Thread(() -> {
ByteBuffer buf = ByteBuffer.allocate(8192);
this.selector = Selector.open();
io_thread = new Thread(() -> {
ByteBuffer buf = ByteBuffer.allocate(8192);
- long lastTimerTick = System.currentTimeMillis();
while (true) {
try {
if (IS_ANDROID) {
while (true) {
try {
if (IS_ANDROID) {
@@
-192,10
+190,6
@@
public class NioPeerHandler {
// no need to do anything here with the PeerManager.
}
}
// no need to do anything here with the PeerManager.
}
}
- if (lastTimerTick < System.currentTimeMillis() - 30 * 1000) {
- peer_manager.timer_tick_occurred();
- lastTimerTick = System.currentTimeMillis();
- }
peer_manager.process_events();
}
}, "NioPeerHandler NIO Thread");
peer_manager.process_events();
}
}, "NioPeerHandler NIO Thread");