net.i2p.client.streaming
Class I2PSocketManagerImpl

java.lang.Object
  extended by net.i2p.client.streaming.I2PSocketManagerImpl
All Implemented Interfaces:
I2PSessionListener, I2PSocketManager

Deprecated. use I2PSocketManagerFull

 class I2PSocketManagerImpl
extends java.lang.Object
implements I2PSocketManager, I2PSessionListener

Centralize the coordination and multiplexing of the local client's streaming. There should be one I2PSocketManager for each I2PSession, and if an application is sending and receiving data through the streaming library using an I2PSocketManager, it should not attempt to call I2PSession's setSessionListener or receive any messages with its .receiveMessage


Nested Class Summary
 
Nested classes/interfaces inherited from interface net.i2p.client.streaming.I2PSocketManager
I2PSocketManager.DisconnectListener
 
Field Summary
static short ACK
          Deprecated.  
static short CHAFF
          Deprecated.  
static short CLOSE_IN
          Deprecated.  
static short CLOSE_OUT
          Deprecated.  
static short DATA_IN
          Deprecated.  
static short DATA_OUT
          Deprecated.  
static short SYN
          Deprecated.  
 
Constructor Summary
I2PSocketManagerImpl()
          Deprecated.  
I2PSocketManagerImpl(java.lang.String name)
          Deprecated.  
 
Method Summary
 void addDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
          Deprecated.  
 I2PSocketOptions buildOptions()
          Deprecated.  
 I2PSocketOptions buildOptions(java.util.Properties opts)
          Deprecated.  
 I2PSocket connect(Destination peer)
          Deprecated. Create a new connected socket (block until the socket is created)
 I2PSocket connect(Destination peer, I2PSocketOptions options)
          Deprecated. Create a new connected socket (block until the socket is created)
 void destroySocketManager()
          Deprecated. Destroy the socket manager, freeing all the associated resources.
 void disconnected(I2PSession session)
          Deprecated. Notify the client that the session has been terminated
 void errorOccurred(I2PSession session, java.lang.String message, java.lang.Throwable error)
          Deprecated. Notify the client that some error occurred
 long getAcceptTimeout()
          Deprecated.  
 I2PSocketOptions getDefaultOptions()
          Deprecated.  
 java.lang.String getName()
          Deprecated.  
static java.lang.String getReadableForm(java.lang.String id)
          Deprecated.  
 I2PServerSocket getServerSocket()
          Deprecated.  
 I2PSession getSession()
          Deprecated.  
 void init(I2PAppContext context, I2PSession session, java.util.Properties opts, java.lang.String name)
          Deprecated.  
 java.util.Set listSockets()
          Deprecated. Retrieve a set of currently connected I2PSockets, either initiated locally or remotely.
static byte[] makePacket(byte type, java.lang.String id, byte[] payload)
          Deprecated. Create a new packet of the given type for the specified connection containing the given payload
 void messageAvailable(I2PSession session, int msgId, long size)
          Deprecated. Instruct the client that the given session has received a message with size # of bytes.
 boolean ping(Destination peer, long timeoutMs)
          Deprecated. timeout is ignored - use I2PSocketManagerFull.ping()
 void removeDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
          Deprecated.  
 void removeSocket(I2PSocketImpl sock)
          Deprecated.  
 void reportAbuse(I2PSession session, int severity)
          Deprecated. Instruct the client that the session specified seems to be under attack and that the client may wish to move its destination to another router.
 void setAcceptTimeout(long ms)
          Deprecated. How long should we wait for the client to .accept() a socket before sending back a NACK/Close?
 void setDefaultOptions(I2PSocketOptions options)
          Deprecated.  
 void setName(java.lang.String name)
          Deprecated.  
 void setSession(I2PSession session)
          Deprecated.  
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACK

public static final short ACK
Deprecated. 
See Also:
Constant Field Values

CLOSE_OUT

public static final short CLOSE_OUT
Deprecated. 
See Also:
Constant Field Values

DATA_OUT

public static final short DATA_OUT
Deprecated. 
See Also:
Constant Field Values

SYN

public static final short SYN
Deprecated. 
See Also:
Constant Field Values

CLOSE_IN

public static final short CLOSE_IN
Deprecated. 
See Also:
Constant Field Values

DATA_IN

public static final short DATA_IN
Deprecated. 
See Also:
Constant Field Values

CHAFF

public static final short CHAFF
Deprecated. 
See Also:
Constant Field Values
Constructor Detail

I2PSocketManagerImpl

public I2PSocketManagerImpl()
Deprecated. 

I2PSocketManagerImpl

public I2PSocketManagerImpl(java.lang.String name)
Deprecated. 
Method Detail

init

public void init(I2PAppContext context,
                 I2PSession session,
                 java.util.Properties opts,
                 java.lang.String name)
Deprecated. 
Specified by:
init in interface I2PSocketManager

getSession

public I2PSession getSession()
Deprecated. 
Specified by:
getSession in interface I2PSocketManager

setSession

public void setSession(I2PSession session)
Deprecated. 

setAcceptTimeout

public void setAcceptTimeout(long ms)
Deprecated. 
How long should we wait for the client to .accept() a socket before sending back a NACK/Close?

Specified by:
setAcceptTimeout in interface I2PSocketManager
Parameters:
ms - milliseconds to wait, maximum

getAcceptTimeout

public long getAcceptTimeout()
Deprecated. 
Specified by:
getAcceptTimeout in interface I2PSocketManager

disconnected

public void disconnected(I2PSession session)
Deprecated. 
Description copied from interface: I2PSessionListener
Notify the client that the session has been terminated

Specified by:
disconnected in interface I2PSessionListener

errorOccurred

public void errorOccurred(I2PSession session,
                          java.lang.String message,
                          java.lang.Throwable error)
Deprecated. 
Description copied from interface: I2PSessionListener
Notify the client that some error occurred

Specified by:
errorOccurred in interface I2PSessionListener

messageAvailable

public void messageAvailable(I2PSession session,
                             int msgId,
                             long size)
Deprecated. 
Description copied from interface: I2PSessionListener
Instruct the client that the given session has received a message with size # of bytes.

Specified by:
messageAvailable in interface I2PSessionListener
Parameters:
session - session to notify
msgId - message number available
size - size of the message - why it's a long and not an int is a mystery

reportAbuse

public void reportAbuse(I2PSession session,
                        int severity)
Deprecated. 
Description copied from interface: I2PSessionListener
Instruct the client that the session specified seems to be under attack and that the client may wish to move its destination to another router.

Specified by:
reportAbuse in interface I2PSessionListener
Parameters:
session - session to report abuse to
severity - how bad the abuse is

setDefaultOptions

public void setDefaultOptions(I2PSocketOptions options)
Deprecated. 
Specified by:
setDefaultOptions in interface I2PSocketManager

getDefaultOptions

public I2PSocketOptions getDefaultOptions()
Deprecated. 
Specified by:
getDefaultOptions in interface I2PSocketManager

buildOptions

public I2PSocketOptions buildOptions()
Deprecated. 
Specified by:
buildOptions in interface I2PSocketManager

buildOptions

public I2PSocketOptions buildOptions(java.util.Properties opts)
Deprecated. 
Specified by:
buildOptions in interface I2PSocketManager

getServerSocket

public I2PServerSocket getServerSocket()
Deprecated. 
Specified by:
getServerSocket in interface I2PSocketManager

connect

public I2PSocket connect(Destination peer,
                         I2PSocketOptions options)
                  throws I2PException,
                         java.net.ConnectException,
                         java.net.NoRouteToHostException,
                         java.io.InterruptedIOException
Deprecated. 
Create a new connected socket (block until the socket is created)

Specified by:
connect in interface I2PSocketManager
Parameters:
peer - Destination to connect to
options - I2P socket options to be used for connecting
Returns:
new connected socket
Throws:
java.net.ConnectException - if the peer refuses the connection
java.net.NoRouteToHostException - if the peer is not found or not reachable
java.io.InterruptedIOException - if the connection timeouts
I2PException - if there is some other I2P-related problem

connect

public I2PSocket connect(Destination peer)
                  throws I2PException,
                         java.net.ConnectException,
                         java.net.NoRouteToHostException,
                         java.io.InterruptedIOException
Deprecated. 
Create a new connected socket (block until the socket is created)

Specified by:
connect in interface I2PSocketManager
Parameters:
peer - Destination to connect to
Returns:
new connected socket
Throws:
java.net.ConnectException - if the peer refuses the connection
java.net.NoRouteToHostException - if the peer is not found or not reachable
java.io.InterruptedIOException - if the connection timeouts
I2PException - if there is some other I2P-related problem

destroySocketManager

public void destroySocketManager()
Deprecated. 
Destroy the socket manager, freeing all the associated resources. This method will block untill all the managed sockets are closed.

Specified by:
destroySocketManager in interface I2PSocketManager

listSockets

public java.util.Set listSockets()
Deprecated. 
Retrieve a set of currently connected I2PSockets, either initiated locally or remotely.

Specified by:
listSockets in interface I2PSocketManager
Returns:
a set of currently connected I2PSockets

ping

public boolean ping(Destination peer,
                    long timeoutMs)
Deprecated. timeout is ignored - use I2PSocketManagerFull.ping()

Ping the specified peer, returning true if they replied to the ping within the timeout specified, false otherwise. This call blocks.

Specified by:
ping in interface I2PSocketManager
Parameters:
timeoutMs - ignored
peer - Destination to ping
Returns:
success or failure

removeSocket

public void removeSocket(I2PSocketImpl sock)
Deprecated. 

getName

public java.lang.String getName()
Deprecated. 
Specified by:
getName in interface I2PSocketManager

setName

public void setName(java.lang.String name)
Deprecated. 
Specified by:
setName in interface I2PSocketManager

addDisconnectListener

public void addDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
Deprecated. 
Specified by:
addDisconnectListener in interface I2PSocketManager

removeDisconnectListener

public void removeDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
Deprecated. 
Specified by:
removeDisconnectListener in interface I2PSocketManager

getReadableForm

public static java.lang.String getReadableForm(java.lang.String id)
Deprecated. 

makePacket

public static byte[] makePacket(byte type,
                                java.lang.String id,
                                byte[] payload)
Deprecated. 
Create a new packet of the given type for the specified connection containing the given payload