I2PSocketOptionsConnectionOptionsclass I2PSocketOptionsImpl extends Object implements I2PSocketOptions
| Modifier and Type | Field | Description |
|---|---|---|
static int |
DEFAULT_BUFFER_SIZE |
|
static int |
DEFAULT_CONNECT_TIMEOUT |
|
static int |
DEFAULT_WRITE_TIMEOUT |
PROP_BUFFER_SIZE, PROP_CONNECT_TIMEOUT, PROP_READ_TIMEOUT, PROP_WRITE_TIMEOUT| Constructor | Description |
|---|---|
I2PSocketOptionsImpl() |
Sets max buffer size, connect timeout, read timeout, and write timeout
from System properties.
|
I2PSocketOptionsImpl(Properties opts) |
Sets max buffer size, connect timeout, read timeout, and write timeout
from properties.
|
I2PSocketOptionsImpl(I2PSocketOptions opts) |
Initializes from System properties then copies over all options.
|
| Modifier and Type | Method | Description |
|---|---|---|
long |
getConnectTimeout() |
How long we will wait for the ACK from a SYN, in milliseconds.
|
static double |
getDouble(Properties opts,
String name,
double defaultVal) |
Not part of the API, not for external use.
|
protected static int |
getInt(Properties opts,
String name,
int defaultVal) |
|
int |
getLocalPort() |
The local port.
|
int |
getMaxBufferSize() |
How much data will we accept that hasn't been written out yet.
|
int |
getPort() |
The remote port.
|
long |
getReadTimeout() |
What is the longest we'll block on the input stream while waiting
for more data.
|
long |
getWriteTimeout() |
What is the longest we'll block on the output stream while waiting
for the data to flush.
|
protected void |
init(Properties opts) |
Sets max buffer size, connect timeout, read timeout, and write timeout
from properties.
|
void |
setConnectTimeout(long ms) |
Define how long we will wait for the ACK from a SYN, in milliseconds.
|
void |
setLocalPort(int port) |
The local port.
|
void |
setMaxBufferSize(int numBytes) |
How much data will we accept that hasn't been written out yet.
|
void |
setPort(int port) |
The remote port.
|
void |
setProperties(Properties opts) |
Sets max buffer size, connect timeout, read timeout, and write timeout
from properties.
|
void |
setReadTimeout(long ms) |
What is the longest we'll block on the input stream while waiting
for more data.
|
void |
setWriteTimeout(long ms) |
What is the longest we'll block on the output stream while waiting
for the data to flush.
|
public static final int DEFAULT_BUFFER_SIZE
public static final int DEFAULT_WRITE_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT
public I2PSocketOptionsImpl()
public I2PSocketOptionsImpl(I2PSocketOptions opts)
opts - may be nullpublic I2PSocketOptionsImpl(Properties opts)
opts - may be nullpublic void setProperties(Properties opts)
opts - may be nullprotected void init(Properties opts)
protected static int getInt(Properties opts, String name, int defaultVal)
public static double getDouble(Properties opts, String name, double defaultVal)
public long getConnectTimeout()
getConnectTimeout in interface I2PSocketOptionspublic void setConnectTimeout(long ms)
setConnectTimeout in interface I2PSocketOptionsms - timeout in mspublic long getReadTimeout()
getReadTimeout in interface I2PSocketOptionspublic void setReadTimeout(long ms)
setReadTimeout in interface I2PSocketOptionsms - timeout in ms, 0 for nonblocking, -1 for foreverpublic int getMaxBufferSize()
getMaxBufferSize in interface I2PSocketOptionspublic void setMaxBufferSize(int numBytes)
setMaxBufferSize in interface I2PSocketOptionsnumBytes - How much data will we accept that hasn't been written out yet.public long getWriteTimeout()
getWriteTimeout in interface I2PSocketOptionspublic void setWriteTimeout(long ms)
setWriteTimeout in interface I2PSocketOptionsms - wait time to block on the output stream while waiting for the data to flush.public int getPort()
getPort in interface I2PSocketOptionspublic void setPort(int port)
setPort in interface I2PSocketOptionsport - 0 - 65535public int getLocalPort()
getLocalPort in interface I2PSocketOptionspublic void setLocalPort(int port)
setLocalPort in interface I2PSocketOptionsport - 0 - 65535