forked from I2P_Developers/i2p.i2p
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user