Package net.i2p.i2pcontrol
Class SocketController
- java.lang.Object
-
- net.i2p.i2pcontrol.SocketController
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static StringPROP_ALLOWED_HOSTS
-
Constructor Summary
Constructors Constructor Description SocketController(RouterContext ctx, ClientAppManager mgr, String[] args)RouterApp (new way)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerSocketbuildServer()Builds a new server.StringgetDisplayName()The display name of the ClientApp, used in user interfaces.StringgetName()The generic name of the ClientApp, used for registration, e.g.ClientAppStategetState()The current state of the ClientApp.voidshutdown(String[] args)Do not take a long time.voidstartup()Do not take a long time.
-
-
-
Field Detail
-
PROP_ALLOWED_HOSTS
static final String PROP_ALLOWED_HOSTS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SocketController
public SocketController(RouterContext ctx, ClientAppManager mgr, String[] args) throws IOException
RouterApp (new way)- Throws:
IOException
-
-
Method Detail
-
startup
public void startup()
Description copied from interface:ClientAppDo not take a long time. Do not block. Start threads here if necessary. Client must call ClientAppManager.notify() at least once within this method to change the state from INITIALIZED to something else. Will not be called multiple times on the same object.
-
shutdown
public void shutdown(String[] args)
Description copied from interface:ClientAppDo not take a long time. Do not block. Use a thread if necessary. If previously running, client must call ClientAppManager.notify() at least once within this method to change the state to STOPPING or STOPPED. May be called multiple times on the same object, in any state.
-
getState
public ClientAppState getState()
Description copied from interface:ClientAppThe current state of the ClientApp.
-
getName
public String getName()
Description copied from interface:ClientAppThe generic name of the ClientApp, used for registration, e.g. "console". Do not translate.
-
getDisplayName
public String getDisplayName()
Description copied from interface:ClientAppThe display name of the ClientApp, used in user interfaces. The app must translate.- Specified by:
getDisplayNamein interfaceClientApp- Returns:
- non-null
-
buildServer
public ServerSocket buildServer() throws IOException
Builds a new server. Used for changing ports during operation and such. Does NOT start the server. Must call start() on the returned server.- Returns:
- Server - A new server built from current configuration.
- Throws:
IOException
-
-