* Streaming:

- Add new real sockets for easier porting of apps.
        See http://zzz.i2p/topics/792 for info.
        Untested.
      - de-SpongeCase
      - Javadoc
This commit is contained in:
zzz
2011-01-05 16:41:41 +00:00
parent 532c9d3fc5
commit 226cb7fdb9
9 changed files with 637 additions and 21 deletions

View File

@@ -10,6 +10,8 @@ import java.io.InterruptedIOException;
import java.io.UnsupportedEncodingException;
import java.net.ConnectException;
import java.net.NoRouteToHostException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -461,6 +463,14 @@ class I2PSocketManagerImpl implements I2PSocketManager, I2PSessionListener {
return _serverSocket;
}
/**
* @throws UnsupportedOperationException
* @since 0.8.4
*/
public ServerSocket getStandardServerSocket() {
throw new UnsupportedOperationException();
}
/**
* Create a new connected socket (block until the socket is created)
*
@@ -601,6 +611,22 @@ class I2PSocketManagerImpl implements I2PSocketManager, I2PSessionListener {
return connect(peer, null);
}
/**
* @throws UnsupportedOperationException
* @since 0.8.4
*/
public Socket connectToSocket(Destination peer) {
throw new UnsupportedOperationException();
}
/**
* @throws UnsupportedOperationException
* @since 0.8.4
*/
public Socket connectToSocket(Destination peer, int timeout) {
throw new UnsupportedOperationException();
}
/**
* Destroy the socket manager, freeing all the associated resources. This
* method will block untill all the managed sockets are closed.
@@ -660,7 +686,7 @@ class I2PSocketManagerImpl implements I2PSocketManager, I2PSessionListener {
* Retrieve a set of currently connected I2PSockets, either initiated locally or remotely.
*
*/
public Set listSockets() {
public Set<I2PSocket> listSockets() {
Set<I2PSocket> sockets = new HashSet<I2PSocket>(8);
synchronized (lock) {
sockets.addAll(_inSockets.values());