|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface I2PSocketManager
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 | |
---|---|
static interface |
I2PSocketManager.DisconnectListener
|
Method Summary | |
---|---|
void |
addDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
|
I2PSocketOptions |
buildOptions()
|
I2PSocketOptions |
buildOptions(java.util.Properties opts)
|
I2PSocket |
connect(Destination peer)
Create a new connected socket (block until the socket is created) |
I2PSocket |
connect(Destination peer,
I2PSocketOptions options)
Create a new connected socket (block until the socket is created) |
void |
destroySocketManager()
Destroy the socket manager, freeing all the associated resources. |
long |
getAcceptTimeout()
|
I2PSocketOptions |
getDefaultOptions()
|
java.lang.String |
getName()
|
I2PServerSocket |
getServerSocket()
|
I2PSession |
getSession()
|
void |
init(I2PAppContext context,
I2PSession session,
java.util.Properties opts,
java.lang.String name)
|
java.util.Set |
listSockets()
Retrieve a set of currently connected I2PSockets, either initiated locally or remotely. |
boolean |
ping(Destination peer,
long timeoutMs)
Ping the specified peer, returning true if they replied to the ping within the timeout specified, false otherwise. |
void |
removeDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
|
void |
setAcceptTimeout(long ms)
How long should we wait for the client to .accept() a socket before sending back a NACK/Close? |
void |
setDefaultOptions(I2PSocketOptions options)
|
void |
setName(java.lang.String name)
|
Method Detail |
---|
I2PSession getSession()
void setAcceptTimeout(long ms)
ms
- milliseconds to wait, maximumlong getAcceptTimeout()
void setDefaultOptions(I2PSocketOptions options)
I2PSocketOptions getDefaultOptions()
I2PServerSocket getServerSocket()
I2PSocketOptions buildOptions()
I2PSocketOptions buildOptions(java.util.Properties opts)
I2PSocket connect(Destination peer, I2PSocketOptions options) throws I2PException, java.net.ConnectException, java.net.NoRouteToHostException, java.io.InterruptedIOException
peer
- Destination to connect tooptions
- I2P socket options to be used for connecting
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 problemI2PSocket connect(Destination peer) throws I2PException, java.net.ConnectException, java.net.NoRouteToHostException, java.io.InterruptedIOException
peer
- Destination to connect to
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 problemvoid destroySocketManager()
java.util.Set listSockets()
boolean ping(Destination peer, long timeoutMs)
java.lang.String getName()
void setName(java.lang.String name)
void init(I2PAppContext context, I2PSession session, java.util.Properties opts, java.lang.String name)
void addDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
void removeDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |