SAM version 3 :

- Raw and Datagram sessions implemented
      - option "SILENT=true" added to the stream protocol
      - java 6 warnings removed
   ministreaming :
      - java 6 warnings removed
   ministreaming and streaming :
      -  added functions : 
      	I2PServerSocket.waitIncoming(long timeout)
      	I2PServerSocket.accept(boolean block)
This commit is contained in:
mkvore-commit
2009-04-02 08:22:31 +00:00
parent 9aa8707647
commit a4d16af95d
44 changed files with 2278 additions and 183 deletions

View File

@@ -30,6 +30,36 @@ public interface I2PServerSocket {
*/
public I2PSocket accept() throws I2PException, ConnectException, SocketTimeoutException;
/**
* accept(true) has the same behaviour as accept().
* accept(false) does not wait for a socket connecting. If a socket is
* available in the queue, it is accepted. Else, null is returned.
*
* @param true if the call should block until a socket is available
*
* @return a connected I2PSocket, or null
*
* @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(boolean blocking) throws I2PException, ConnectException, SocketTimeoutException;
/**
* Waits until there is a socket waiting for acception or the timeout is
* reached.
*
* @param timeoutMs timeout in ms. A negative value waits forever.
*
* @return true if a socket is available, false if not
*
* @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 boolean waitIncoming(long timeoutMs) throws I2PException, ConnectException, InterruptedException;
/**
* Set Sock Option accept timeout
* @param x timeout in ms