forked from I2P_Developers/i2p.i2p
Set BOB source/target to JDK 5 (AKA 1.5)
Minor bugfixes/code cleanup on BOB Add/Cleanup some documentation to streaming lib javadocs
This commit is contained in:
@@ -40,8 +40,8 @@ javac.classpath=\
|
|||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
javac.source=1.4
|
javac.source=1.5
|
||||||
javac.target=1.4
|
javac.target=1.5
|
||||||
javac.test.classpath=\
|
javac.test.classpath=\
|
||||||
${javac.classpath}:\
|
${javac.classpath}:\
|
||||||
${build.classes.dir}:\
|
${build.classes.dir}:\
|
||||||
|
@@ -58,16 +58,15 @@ public class I2Plistener implements Runnable {
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
this._log = _log;
|
this._log = _log;
|
||||||
this.socketManager = S;
|
this.socketManager = S;
|
||||||
serverSocket = socketManager.getServerSocket();
|
serverSocket = this.socketManager.getServerSocket();
|
||||||
tgwatch = 1;
|
tgwatch = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simply listen on I2P port, and thread connections
|
* Simply listen on I2P port, and thread connections
|
||||||
*
|
*
|
||||||
* @throws RuntimeException
|
|
||||||
*/
|
*/
|
||||||
public void run() throws RuntimeException {
|
public void run() {
|
||||||
boolean g = false;
|
boolean g = false;
|
||||||
I2PSocket sessSocket = null;
|
I2PSocket sessSocket = null;
|
||||||
|
|
||||||
@@ -123,6 +122,7 @@ public class I2Plistener implements Runnable {
|
|||||||
// nop
|
// nop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// System.out.println("STOP Thread count " + Thread.activeCount());
|
// System.out.println("STOP Thread count " + Thread.activeCount());
|
||||||
// need to kill off the socket manager too.
|
// need to kill off the socket manager too.
|
||||||
I2PSession session = socketManager.getSession();
|
I2PSession session = socketManager.getSession();
|
||||||
@@ -134,7 +134,5 @@ public class I2Plistener implements Runnable {
|
|||||||
}
|
}
|
||||||
// System.out.println("destroySession Thread count " + Thread.activeCount());
|
// System.out.println("destroySession Thread count " + Thread.activeCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,7 +21,6 @@
|
|||||||
*
|
*
|
||||||
* ...for any additional details and liscense questions.
|
* ...for any additional details and liscense questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.i2p.BOB;
|
package net.i2p.BOB;
|
||||||
|
|
||||||
import net.i2p.client.streaming.RetransmissionTimer;
|
import net.i2p.client.streaming.RetransmissionTimer;
|
||||||
@@ -33,7 +32,6 @@ import net.i2p.util.SimpleTimer;
|
|||||||
* @author sponge
|
* @author sponge
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -65,10 +65,11 @@ public class TCPlistener implements Runnable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Simply listen on TCP port, and thread connections
|
* Simply listen on TCP port, and thread connections
|
||||||
* @throws java.lang.RuntimeException
|
*
|
||||||
*/
|
*/
|
||||||
public void run() throws RuntimeException {
|
public void run() {
|
||||||
boolean g = false;
|
boolean g = false;
|
||||||
|
boolean spin = true;
|
||||||
database.getReadLock();
|
database.getReadLock();
|
||||||
info.getReadLock();
|
info.getReadLock();
|
||||||
if(info.exists("OUTPORT")) {
|
if(info.exists("OUTPORT")) {
|
||||||
@@ -81,7 +82,6 @@ public class TCPlistener implements Runnable {
|
|||||||
listener.setSoTimeout(1000);
|
listener.setSoTimeout(1000);
|
||||||
info.releaseReadLock();
|
info.releaseReadLock();
|
||||||
database.releaseReadLock();
|
database.releaseReadLock();
|
||||||
boolean spin = true;
|
|
||||||
while(spin) {
|
while(spin) {
|
||||||
database.getReadLock();
|
database.getReadLock();
|
||||||
info.getReadLock();
|
info.getReadLock();
|
||||||
@@ -105,7 +105,20 @@ public class TCPlistener implements Runnable {
|
|||||||
}
|
}
|
||||||
listener.close();
|
listener.close();
|
||||||
} catch(IOException ioe) {
|
} catch(IOException ioe) {
|
||||||
// throw new RuntimeException(ioe);
|
// Fatal failure, cause a stop event
|
||||||
|
database.getReadLock();
|
||||||
|
info.getReadLock();
|
||||||
|
spin = info.get("RUNNING").equals(Boolean.TRUE);
|
||||||
|
info.releaseReadLock();
|
||||||
|
database.releaseReadLock();
|
||||||
|
if(spin) {
|
||||||
|
database.getWriteLock();
|
||||||
|
info.getWriteLock();
|
||||||
|
info.add("STOPPING", new Boolean(true));
|
||||||
|
info.add("RUNNING", new Boolean(false));
|
||||||
|
info.releaseWriteLock();
|
||||||
|
database.releaseWriteLock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//System.out.println("STOP!");
|
//System.out.println("STOP!");
|
||||||
|
@@ -21,7 +21,6 @@
|
|||||||
*
|
*
|
||||||
* ...for any additional details and liscense questions.
|
* ...for any additional details and liscense questions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package net.i2p.BOB;
|
package net.i2p.BOB;
|
||||||
|
|
||||||
import java.io.DataInputStream;
|
import java.io.DataInputStream;
|
||||||
@@ -34,7 +33,6 @@ import net.i2p.client.I2PSessionListener;
|
|||||||
import net.i2p.data.Destination;
|
import net.i2p.data.Destination;
|
||||||
import net.i2p.util.Log;
|
import net.i2p.util.Log;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UDP IO on I2P
|
* UDP IO on I2P
|
||||||
*
|
*
|
||||||
@@ -62,13 +60,15 @@ public class UDPIOthread implements I2PSessionListener, Runnable {
|
|||||||
* @param _log
|
* @param _log
|
||||||
* @param socket
|
* @param socket
|
||||||
* @param _session
|
* @param _session
|
||||||
*/ UDPIOthread(nickname info, Log _log, Socket socket, I2PSession _session) {
|
*/
|
||||||
|
UDPIOthread(nickname info, Log _log, Socket socket, I2PSession _session) {
|
||||||
this.info = info;
|
this.info = info;
|
||||||
this._log = _log;
|
this._log = _log;
|
||||||
this.socket = socket;
|
this.socket = socket;
|
||||||
this._session = _session;
|
this._session = _session;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -103,6 +103,7 @@ public class UDPIOthread implements I2PSessionListener, Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param session
|
* @param session
|
||||||
@@ -123,7 +124,6 @@ public class UDPIOthread implements I2PSessionListener, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Great, can these be used to kill ourselves.
|
// Great, can these be used to kill ourselves.
|
||||||
|
|
||||||
/** required by {@link I2PSessionListener I2PSessionListener} to notify of disconnect */
|
/** required by {@link I2PSessionListener I2PSessionListener} to notify of disconnect */
|
||||||
public void disconnected(I2PSession session) {
|
public void disconnected(I2PSession session) {
|
||||||
_log.debug("Disconnected");
|
_log.debug("Disconnected");
|
||||||
|
@@ -70,6 +70,9 @@ public class doCMDS implements Runnable {
|
|||||||
private static final String P_RUNNING = "RUNNING";
|
private static final String P_RUNNING = "RUNNING";
|
||||||
private static final String P_STARTING = "STARTING";
|
private static final String P_STARTING = "STARTING";
|
||||||
private static final String P_STOPPING = "STOPPING";
|
private static final String P_STOPPING = "STOPPING";
|
||||||
|
// private static final String P_INSTATE = "INSTATE";
|
||||||
|
// private static final String P_OUTSTATE = "OUTSTATE";
|
||||||
|
|
||||||
/* command strings */
|
/* command strings */
|
||||||
private static final String C_help = "help";
|
private static final String C_help = "help";
|
||||||
private static final String C_clear = "clear";
|
private static final String C_clear = "clear";
|
||||||
@@ -490,6 +493,8 @@ public class doCMDS implements Runnable {
|
|||||||
wlock();
|
wlock();
|
||||||
database.add(Arg, nickinfo);
|
database.add(Arg, nickinfo);
|
||||||
nickinfo.add(P_NICKNAME, Arg);
|
nickinfo.add(P_NICKNAME, Arg);
|
||||||
|
// nickinfo.add(P_INSTATE,new Boolean(false));
|
||||||
|
// nickinfo.add(P_OUTSTATE,new Boolean(false));
|
||||||
nickinfo.add(P_STARTING, Boolean.FALSE);
|
nickinfo.add(P_STARTING, Boolean.FALSE);
|
||||||
nickinfo.add(P_RUNNING, Boolean.FALSE);
|
nickinfo.add(P_RUNNING, Boolean.FALSE);
|
||||||
nickinfo.add(P_STOPPING, Boolean.FALSE);
|
nickinfo.add(P_STOPPING, Boolean.FALSE);
|
||||||
|
@@ -34,6 +34,7 @@ public class nickname {
|
|||||||
private volatile Object[][] data;
|
private volatile Object[][] data;
|
||||||
private volatile int index, writersWaiting, readers;
|
private volatile int index, writersWaiting, readers;
|
||||||
private volatile boolean writingInProgress;
|
private volatile boolean writingInProgress;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* make initial NULL object
|
* make initial NULL object
|
||||||
*
|
*
|
||||||
|
@@ -113,7 +113,7 @@ public class ConnectionManager {
|
|||||||
public void setAllowIncomingConnections(boolean allow) {
|
public void setAllowIncomingConnections(boolean allow) {
|
||||||
_connectionHandler.setActive(allow);
|
_connectionHandler.setActive(allow);
|
||||||
}
|
}
|
||||||
/** should we acceot connections, or just reject everyone? */
|
/** @return if we should accept connections */
|
||||||
public boolean getAllowIncomingConnections() {
|
public boolean getAllowIncomingConnections() {
|
||||||
return _connectionHandler.getActive();
|
return _connectionHandler.getActive();
|
||||||
}
|
}
|
||||||
|
@@ -181,6 +181,7 @@ public class I2PSocketManagerFull implements I2PSocketManager {
|
|||||||
* @param peer Destination to connect to
|
* @param peer Destination to connect to
|
||||||
* @param options I2P socket options to be used for connecting
|
* @param options I2P socket options to be used for connecting
|
||||||
*
|
*
|
||||||
|
* @return I2PSocket if successful
|
||||||
* @throws NoRouteToHostException if the peer is not found or not reachable
|
* @throws NoRouteToHostException if the peer is not found or not reachable
|
||||||
* @throws I2PException if there is some other I2P-related problem
|
* @throws I2PException if there is some other I2P-related problem
|
||||||
*/
|
*/
|
||||||
@@ -215,6 +216,7 @@ public class I2PSocketManagerFull implements I2PSocketManager {
|
|||||||
*
|
*
|
||||||
* @param peer Destination to connect to
|
* @param peer Destination to connect to
|
||||||
*
|
*
|
||||||
|
* @return I2PSocket if successful
|
||||||
* @throws NoRouteToHostException if the peer is not found or not reachable
|
* @throws NoRouteToHostException if the peer is not found or not reachable
|
||||||
* @throws I2PException if there is some other I2P-related problem
|
* @throws I2PException if there is some other I2P-related problem
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user