java.lang.Runnable
, EventDispatcher
I2PTunnelDCCServer
, I2PTunnelHTTPServer
, I2PTunnelIRCServer
public class I2PTunnelServer extends I2PTunnelTask implements java.lang.Runnable
修飾子とタイプ | フィールド | 説明 |
---|---|---|
protected static long |
__serverId |
apparently unused
|
protected java.util.concurrent.ThreadPoolExecutor |
_clientExecutor |
|
protected Log |
_log |
|
protected boolean |
bidir |
|
protected I2PServerSocket |
i2pss |
|
protected Logging |
l |
|
protected int |
localPort |
|
static java.lang.String |
PROP_ALT_PKF |
|
static java.lang.String |
PROP_UNIQUE_LOCAL |
|
static java.lang.String |
PROP_USE_SSL |
|
protected long |
readTimeout |
default timeout to 5 minutes - override if desired
|
protected java.net.InetAddress |
remoteHost |
|
protected int |
remotePort |
|
protected java.lang.Object |
slock |
|
protected I2PSocketManager |
sockMgr |
|
protected java.lang.Object |
sslLock |
|
protected I2PTunnelTask |
task |
open
コンストラクタ | 説明 |
---|---|
I2PTunnelServer(java.net.InetAddress host,
int port,
java.io.File privkey,
java.lang.String privkeyname,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel) |
Non-blocking
|
I2PTunnelServer(java.net.InetAddress host,
int port,
java.io.InputStream privData,
java.lang.String privkeyname,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel) |
Non-blocking
|
I2PTunnelServer(java.net.InetAddress host,
int port,
java.lang.String privData,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel) |
Non-blocking
|
I2PTunnelServer(java.net.InetAddress host,
int port,
I2PSocketManager sktMgr,
Logging l,
EventDispatcher notifyThis,
I2PTunnel tunnel) |
Non-blocking
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
protected void |
blockingHandle(I2PSocket socket) |
This is run in a thread from a limited-size thread pool via Handler.run(),
except for a standard server (this class, no extension, as determined in getUsePool()),
it is run directly in the acceptor thread (see run()).
|
boolean |
close(boolean forced) |
Note that the tunnel can be reopened after this by calling startRunning().
|
boolean |
destroy() |
Note that the tunnel cannot be reopened after this by calling startRunning(),
as it will destroy the underlying socket manager.
|
protected int |
getHandlerCount() |
|
long |
getReadTimeout() |
Get the read idle timeout for newly-created connections (in
milliseconds).
|
protected java.net.Socket |
getSocket(Hash from,
int incomingPort) |
Get a regular or SSL socket depending on config and the incoming port.
|
protected java.net.Socket |
getSocket(Hash from,
java.net.InetAddress remoteHost,
int remotePort) |
Get a regular or SSL socket depending on config.
|
void |
optionsUpdated(I2PTunnel tunnel) |
Update the I2PSocketManager.
|
void |
run() |
If usePool is set, this starts the executor pool.
|
void |
setReadTimeout(long ms) |
Set the read idle timeout for newly-created connections (in
milliseconds).
|
boolean |
shouldUsePool() |
|
void |
startRunning() |
Start running the I2PTunnelServer.
|
attachEventDispatcher, detachEventDispatcher, getEventDispatcher, getEvents, getEventValue, ignoreEvents, notifyEvent, unIgnoreEvents, waitEventValue
connected, disconnected, errorOccurred, getId, getTunnel, isOpen, reportAbuse, routerDisconnected, setId, setName, setTunnel, toString
protected final Log _log
protected final I2PSocketManager sockMgr
protected volatile I2PServerSocket i2pss
protected final java.lang.Object slock
protected final java.lang.Object sslLock
protected java.net.InetAddress remoteHost
protected int remotePort
protected final Logging l
protected long readTimeout
public static final java.lang.String PROP_USE_SSL
public static final java.lang.String PROP_UNIQUE_LOCAL
public static final java.lang.String PROP_ALT_PKF
protected static volatile long __serverId
protected I2PTunnelTask task
protected boolean bidir
protected volatile java.util.concurrent.ThreadPoolExecutor _clientExecutor
protected int localPort
public I2PTunnelServer(java.net.InetAddress host, int port, java.lang.String privData, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
privData
- Base64-encoded private key data,
format is specified in PrivateKeyFile
java.lang.IllegalArgumentException
- if the I2CP configuration is b0rked so
badly that we cant create a socketManagerpublic I2PTunnelServer(java.net.InetAddress host, int port, java.io.File privkey, java.lang.String privkeyname, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
privkey
- file containing the private key data,
format is specified in PrivateKeyFile
privkeyname
- the name of the privKey file, just for loggingjava.lang.IllegalArgumentException
- if the I2CP configuration is b0rked so
badly that we cant create a socketManagerpublic I2PTunnelServer(java.net.InetAddress host, int port, java.io.InputStream privData, java.lang.String privkeyname, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
privData
- stream containing the private key data,
format is specified in PrivateKeyFile
privkeyname
- the name of the privKey file, just for loggingjava.lang.IllegalArgumentException
- if the I2CP configuration is b0rked so
badly that we cant create a socketManagerpublic I2PTunnelServer(java.net.InetAddress host, int port, I2PSocketManager sktMgr, Logging l, EventDispatcher notifyThis, I2PTunnel tunnel)
sktMgr
- the existing socket managerpublic void startRunning()
java.lang.IllegalArgumentException
- if the I2CP configuration is b0rked so
badly that we cant create a socketManagerpublic void setReadTimeout(long ms)
public long getReadTimeout()
public boolean close(boolean forced)
close
クラス内 I2PTunnelTask
public boolean destroy()
destroy
クラス内 I2PTunnelTask
public void optionsUpdated(I2PTunnel tunnel)
optionsUpdated
クラス内 I2PTunnelTask
protected int getHandlerCount()
public void run()
run
インタフェース内 java.lang.Runnable
public boolean shouldUsePool()
protected void blockingHandle(I2PSocket socket)
protected java.net.Socket getSocket(Hash from, int incomingPort) throws java.io.IOException
from
- may be used to construct local address since 0.9.13java.io.IOException
protected java.net.Socket getSocket(Hash from, java.net.InetAddress remoteHost, int remotePort) throws java.io.IOException
from
- may be used to construct local address since 0.9.13java.io.IOException