* if we send a blank ACK message (that will not in turn be ACKed) and it

has session tags within it, send an additional ping to the peer,
  bundling those tags a second time, ACKing those tags on the pong.
* handle packets transferred during a race after the receiver ACKs the
  connection but before the establisher receives the ACK.
* notify the messageInputStream reader on close (duh)
* new stream sink test, shoving lots and lots of data down a stream
  with the existing StreamSinkServer and StreamSinkClient apps
* logging
This commit is contained in:
jrandom
2004-10-24 23:23:35 +00:00
committed by zzz
parent 9680effb9f
commit 8de41acfe1
15 changed files with 248 additions and 66 deletions

View File

@@ -0,0 +1,56 @@
package net.i2p.client.streaming;
/**
*
*/
public class StreamSinkTest {
public static void main(String args[]) {
System.setProperty(I2PSocketManagerFactory.PROP_MANAGER, I2PSocketManagerFull.class.getName());
new Thread(new Runnable() {
public void run() {
StreamSinkServer.main(new String[] { "streamSinkTestDir", "streamSinkTestServer.key" });
}
}, "server").start();
try { Thread.sleep(30*1000); } catch (Exception e) {}
//run(256, 10000);
//run(256, 1000);
//run(1024, 10);
run(32*1024, 1);
//run("/home/jrandom/streamSinkTestDir/clientSink36766.dat", 1);
//run(512*1024, 1);
try { Thread.sleep(10*1000); } catch (InterruptedException e) {}
System.out.println("Shutting down");
System.exit(0);
}
private static void run(final int kb, final int msBetweenWrites) {
Thread t = new Thread(new Runnable() {
public void run() {
StreamSinkClient.main(new String[] { kb+"", msBetweenWrites+"", "streamSinkTestServer.key" });
}
});
t.start();
System.out.println("client and server started: size = " + kb + "KB, delay = " + msBetweenWrites);
try {
t.join();
} catch (InterruptedException ie) {}
}
private static void run(final String filename, final int msBetweenWrites) {
Thread t = new Thread(new Runnable() {
public void run() {
StreamSinkSend.main(new String[] { filename, msBetweenWrites+"", "streamSinkTestServer.key" });
}
});
t.start();
System.out.println("client and server started: file " + filename + ", delay = " + msBetweenWrites);
try {
t.join();
} catch (InterruptedException ie) {}
}
}