forked from I2P_Developers/i2p.i2p
Added {get,set}SOTimeout() to the ServerSocket API,
and fixed all the broken mainstream applications depending on it. Fixed a grave bug in SimpleTimer. Fixed Steraming Timer to be public. Fixed a pile of JavaDoc comments, and reformatted the files I touched.
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;
|
||||
|
||||
/**
|
||||
@@ -9,26 +10,40 @@ import net.i2p.I2PException;
|
||||
*
|
||||
*/
|
||||
public interface I2PServerSocket {
|
||||
/**
|
||||
* Closes the socket.
|
||||
*/
|
||||
public void close() throws I2PException;
|
||||
|
||||
/**
|
||||
* Waits for the next socket connecting. If a remote user tried to make a
|
||||
* connection and the local application wasn't .accept()ing new connections,
|
||||
* they should get refused (if .accept() doesnt occur in some small period)
|
||||
*
|
||||
* @return a connected I2PSocket
|
||||
*
|
||||
* @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
|
||||
*/
|
||||
public I2PSocket accept() throws I2PException, ConnectException;
|
||||
/**
|
||||
* Closes the socket.
|
||||
*/
|
||||
public void close() throws I2PException;
|
||||
|
||||
/**
|
||||
* Access the manager which is coordinating the server socket
|
||||
*/
|
||||
public I2PSocketManager getManager();
|
||||
/**
|
||||
* Waits for the next socket connecting. If a remote user tried to make a
|
||||
* connection and the local application wasn't .accept()ing new connections,
|
||||
* they should get refused (if .accept() doesnt occur in some small period)
|
||||
*
|
||||
* @return a connected I2PSocket
|
||||
*
|
||||
* @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, 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
|
||||
*/
|
||||
public I2PSocketManager getManager();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user