Files
i2p.i2p/apps/streaming/java/src/net/i2p/client/streaming/I2PServerSocketFull.java
zzz 226cb7fdb9 * Streaming:
- Add new real sockets for easier porting of apps.
        See http://zzz.i2p/topics/792 for info.
        Untested.
      - de-SpongeCase
      - Javadoc
2011-01-05 16:41:41 +00:00

50 lines
1.2 KiB
Java

package net.i2p.client.streaming;
import java.net.SocketTimeoutException;
import net.i2p.I2PException;
/**
* Bridge to allow accepting new connections
*
*/
class I2PServerSocketFull implements I2PServerSocket {
private I2PSocketManagerFull _socketManager;
public I2PServerSocketFull(I2PSocketManagerFull mgr) {
_socketManager = mgr;
}
/**
* Warning, unlike regular ServerSocket, may return null
*
* @return I2PSocket OR NULL
* @throws net.i2p.I2PException
* @throws SocketTimeoutException
*/
public I2PSocket accept() throws I2PException, SocketTimeoutException {
return _socketManager.receiveSocket();
}
public long getSoTimeout() {
return _socketManager.getConnectionManager().getSoTimeout();
}
public void setSoTimeout(long x) {
_socketManager.getConnectionManager().setSoTimeout(x);
}
/**
* Close the connection.
*/
public void close() {
_socketManager.getConnectionManager().setAllowIncomingConnections(false);
}
/**
*
* @return _socketManager
*/
public I2PSocketManager getManager() {
return _socketManager;
}
}