Added Simple true/false storage class to the utilities
Added socketSoTimeout CHANGED RetransmissionTimer is now public FIXED SimpleTimer has a way to be stopped, and reap it's children CLEANUP A few javadoc additions, where I could figgure out bits CLEANUP all code that needed to catch the timeout exception for socketSoTimeout
This commit is contained in:
@ -2,6 +2,7 @@ package net.i2p.client.streaming;
|
||||
|
||||
import java.net.ConnectException;
|
||||
|
||||
import java.net.SocketTimeoutException;
|
||||
import net.i2p.I2PException;
|
||||
|
||||
/**
|
||||
@ -24,8 +25,21 @@ public interface I2PServerSocket {
|
||||
* @throws I2PException if there is a problem with reading a new socket
|
||||
* from the data available (aka the I2PSession closed, etc)
|
||||
* @throws ConnectException if the I2PServerSocket is closed
|
||||
* @throws SocketTimeoutException
|
||||
*/
|
||||
public I2PSocket accept() throws I2PException, ConnectException;
|
||||
public I2PSocket accept() throws I2PException, ConnectException, SocketTimeoutException;
|
||||
|
||||
/**
|
||||
* Set Sock Option accept timeout
|
||||
* @param x
|
||||
*/
|
||||
public void setSoTimeout(long x);
|
||||
|
||||
/**
|
||||
* Get Sock Option accept timeout
|
||||
* @return timeout
|
||||
*/
|
||||
public long getSoTimeout();
|
||||
|
||||
/**
|
||||
* Access the manager which is coordinating the server socket
|
||||
|
@ -30,6 +30,21 @@ class I2PServerSocketImpl implements I2PServerSocket {
|
||||
/** lock on this when adding a new socket to the pending list, and wait on it accordingly */
|
||||
private Object socketAddedLock = new Object();
|
||||
|
||||
/**
|
||||
* Set Sock Option accept timeout stub, does nothing
|
||||
* @param x
|
||||
*/
|
||||
public void setSoTimeout(long x) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Sock Option accept timeout stub, does nothing
|
||||
* @return timeout
|
||||
*/
|
||||
public long getSoTimeout() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public I2PServerSocketImpl(I2PSocketManager mgr) {
|
||||
this.mgr = mgr;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.ConnectException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.Properties;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
@ -107,6 +108,8 @@ public class StreamSinkServer {
|
||||
} catch (ConnectException ce) {
|
||||
_log.error("Connection already dropped", ce);
|
||||
return;
|
||||
} catch(SocketTimeoutException ste) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user