|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.i2p.client.streaming.I2PSocketManagerFull
public class I2PSocketManagerFull
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 This is what I2PSocketManagerFactory.createManager() returns. Direct instantiation by others is deprecated.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface net.i2p.client.streaming.I2PSocketManager |
|---|
I2PSocketManager.DisconnectListener |
| Constructor Summary | |
|---|---|
I2PSocketManagerFull()
Deprecated. use 4-arg constructor |
|
I2PSocketManagerFull(I2PAppContext context,
I2PSession session,
Properties opts,
String name)
This is what I2PSocketManagerFactory.createManager() returns. |
|
| Method Summary | |
|---|---|
void |
addDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
|
I2PSocketOptions |
buildOptions()
Create a copy of the current options, to be used in a setDefaultOptions() call. |
I2PSocketOptions |
buildOptions(Properties opts)
Create a modified copy of the current options, to be used in a setDefaultOptions() call. |
I2PSocket |
connect(Destination peer)
Create a new connected socket. |
I2PSocket |
connect(Destination peer,
I2PSocketOptions options)
Create a new connected socket. |
Socket |
connectToSocket(Destination peer)
Like connect() but returns a real Socket, and throws only IOE, for easier porting of apps. |
Socket |
connectToSocket(Destination peer,
int timeout)
Like connect() but returns a real Socket, and throws only IOE, for easier porting of apps. |
void |
destroySocketManager()
Destroy the socket manager, freeing all the associated resources. |
long |
getAcceptTimeout()
|
ConnectionManager |
getConnectionManager()
|
I2PSocketOptions |
getDefaultOptions()
Current options, not a copy, setters may be used to make changes. |
String |
getName()
|
I2PServerSocket |
getServerSocket()
|
I2PSession |
getSession()
|
ServerSocket |
getStandardServerSocket()
Like getServerSocket but returns a real ServerSocket for easier porting of apps. |
void |
init(I2PAppContext context,
I2PSession session,
Properties opts,
String name)
Deprecated. use 4-arg constructor |
Set<I2PSocket> |
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. |
I2PSocket |
receiveSocket()
|
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)
Update the options on a running socket manager. |
void |
setName(String name)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public I2PSocketManagerFull()
UnsupportedOperationException - always
public I2PSocketManagerFull(I2PAppContext context,
I2PSession session,
Properties opts,
String name)
context - session - opts - name - | Method Detail |
|---|
public void init(I2PAppContext context,
I2PSession session,
Properties opts,
String name)
I2PSocketManager
init in interface I2PSocketManagerUnsupportedOperationException - alwayspublic I2PSocketOptions buildOptions()
buildOptions in interface I2PSocketManagerpublic I2PSocketOptions buildOptions(Properties opts)
buildOptions in interface I2PSocketManageropts - The new options, may be nullpublic I2PSession getSession()
getSession in interface I2PSocketManagerpublic ConnectionManager getConnectionManager()
public I2PSocket receiveSocket()
throws I2PException,
SocketTimeoutException
I2PException
SocketTimeoutException
public boolean ping(Destination peer,
long timeoutMs)
ping in interface I2PSocketManagerpeer - timeoutMs -
public void setAcceptTimeout(long ms)
setAcceptTimeout in interface I2PSocketManagerms - milliseconds to wait, maximumpublic long getAcceptTimeout()
getAcceptTimeout in interface I2PSocketManagerpublic void setDefaultOptions(I2PSocketOptions options)
setDefaultOptions in interface I2PSocketManageroptions - as created from a call to buildOptions(properties), non-nullpublic I2PSocketOptions getDefaultOptions()
getDefaultOptions in interface I2PSocketManagerpublic I2PServerSocket getServerSocket()
getServerSocket in interface I2PSocketManager
public ServerSocket getStandardServerSocket()
throws IOException
getStandardServerSocket in interface I2PSocketManagerIOException
public I2PSocket connect(Destination peer,
I2PSocketOptions options)
throws I2PException,
NoRouteToHostException
connect in interface I2PSocketManagerpeer - Destination to connect tooptions - I2P socket options to be used for connecting, may be null
NoRouteToHostException - if the peer is not found or not reachable
I2PException - if there is some other I2P-related problem
public I2PSocket connect(Destination peer)
throws I2PException,
NoRouteToHostException
connect in interface I2PSocketManagerpeer - Destination to connect to
NoRouteToHostException - if the peer is not found or not reachable
I2PException - if there is some other I2P-related problem
public Socket connectToSocket(Destination peer)
throws IOException
connectToSocket in interface I2PSocketManagerIOException
public Socket connectToSocket(Destination peer,
int timeout)
throws IOException
connectToSocket in interface I2PSocketManagertimeout - ms if > 0, forces blocking (disables connectDelay)
IOExceptionpublic void destroySocketManager()
destroySocketManager in interface I2PSocketManagerpublic Set<I2PSocket> listSockets()
listSockets in interface I2PSocketManagerpublic String getName()
getName in interface I2PSocketManagerpublic void setName(String name)
setName in interface I2PSocketManagerpublic void addDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
addDisconnectListener in interface I2PSocketManagerpublic void removeDisconnectListener(I2PSocketManager.DisconnectListener lsnr)
removeDisconnectListener in interface I2PSocketManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||