2005-12-21 jrandom

* Adjusted I2PSnark's usage of the streaming lib (tweaking it for BT's
      behavior)
    * Fixed the I2PSnark bug that would lose track of live peers
This commit is contained in:
jrandom
2005-12-21 12:04:54 +00:00
committed by zzz
parent 702e5a5eab
commit 98277d3b64
9 changed files with 101 additions and 49 deletions

View File

@@ -56,7 +56,7 @@ class PeerConnectionOut implements Runnable
}
public void startup() {
thread = new I2PThread(this, "Snark sender " + _id);
thread = new I2PThread(this, "Snark sender " + _id + ": " + peer);
thread.start();
}
@@ -82,7 +82,7 @@ class PeerConnectionOut implements Runnable
dout.flush();
// Wait till more data arrives.
sendQueue.wait();
sendQueue.wait(60*1000);
}
catch (InterruptedException ie)
{
@@ -185,6 +185,13 @@ class PeerConnectionOut implements Runnable
sendQueue.clear();
sendQueue.notify();
}
if (dout != null) {
try {
dout.close();
} catch (IOException ioe) {
_log.warn("Error closing the stream to " + peer, ioe);
}
}
}
/**