This commit is contained in:
zzz
2013-12-05 16:21:36 +00:00
parent d87d4eb232
commit 46e7e9be82
5 changed files with 13 additions and 74 deletions

View File

@@ -1,8 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package net.i2p.i2ptunnel.streamr;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -17,6 +12,7 @@ import net.i2p.i2ptunnel.udp.*;
* @author zzz modded for I2PTunnel
*/
public class MultiSource implements Source, Sink {
public MultiSource() {
this.sinks = new CopyOnWriteArrayList<Destination>();
}
@@ -45,20 +41,6 @@ public class MultiSource implements Source, Sink {
this.sinks.remove(sink);
}
private Sink sink;
private List<Destination> sinks;
private final List<Destination> sinks;
}

View File

@@ -7,9 +7,11 @@ import net.i2p.i2ptunnel.udp.*;
* @author welterde/zzz
*/
public class Pinger implements Source, Runnable {
public Pinger() {
this.thread = new Thread(this);
}
public void setSink(Sink sink) {
this.sink = sink;
}
@@ -53,7 +55,7 @@ public class Pinger implements Source, Runnable {
}
protected Sink sink;
protected Thread thread;
protected final Thread thread;
private final Object waitlock = new Object();
protected boolean running;
protected volatile boolean running;
}

View File

@@ -1,8 +1,3 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package net.i2p.i2ptunnel.streamr;
import java.net.InetAddress;
@@ -52,16 +47,7 @@ public class StreamrConsumer extends I2PTunnelUDPClientBase {
this.sink.stop();
return super.close(forced);
}
private UDPSink sink;
private Pinger pinger;
private final UDPSink sink;
private final Pinger pinger;
}

View File

@@ -1,14 +1,7 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package net.i2p.i2ptunnel.streamr;
// system
import java.io.File;
// i2p
import net.i2p.i2ptunnel.I2PTunnel;
import net.i2p.i2ptunnel.Logging;
import net.i2p.i2ptunnel.udp.*;
@@ -57,17 +50,8 @@ public class StreamrProducer extends I2PTunnelUDPServerBase {
this.multi.stop();
return super.close(forced);
}
private MultiSource multi;
private UDPSource server;
private Sink subscriber;
private final MultiSource multi;
private final UDPSource server;
private final Sink subscriber;
}

View File

@@ -1,11 +1,5 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package net.i2p.i2ptunnel.streamr;
// system
import java.util.Set;
import net.i2p.data.Destination;
@@ -51,15 +45,6 @@ public class Subscriber implements Sink {
}
}
private Set<Destination> subscriptions;
private MultiSource multi;
private final Set<Destination> subscriptions;
private final MultiSource multi;
}