net.i2p.client.streaming
Interface I2PSocketOptions

All Known Implementing Classes:
ConnectionOptions, I2PSocketOptionsImpl

public interface I2PSocketOptions

Define the configuration for streaming and verifying data on the socket.


Field Summary
static java.lang.String PROP_BUFFER_SIZE
           
static java.lang.String PROP_CONNECT_TIMEOUT
           
static java.lang.String PROP_READ_TIMEOUT
           
static java.lang.String PROP_WRITE_TIMEOUT
           
 
Method Summary
 long getConnectTimeout()
          How long we will wait for the ACK from a SYN, in milliseconds.
 int getMaxBufferSize()
          How much data will we accept that hasn't been written out yet.
 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.
 void setConnectTimeout(long ms)
          Define how long we will wait for the ACK from a SYN, in milliseconds.
 void setMaxBufferSize(int numBytes)
          How much data will we accept that hasn't been written out yet.
 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.
 

Field Detail

PROP_BUFFER_SIZE

static final java.lang.String PROP_BUFFER_SIZE
See Also:
Constant Field Values

PROP_CONNECT_TIMEOUT

static final java.lang.String PROP_CONNECT_TIMEOUT
See Also:
Constant Field Values

PROP_READ_TIMEOUT

static final java.lang.String PROP_READ_TIMEOUT
See Also:
Constant Field Values

PROP_WRITE_TIMEOUT

static final java.lang.String PROP_WRITE_TIMEOUT
See Also:
Constant Field Values
Method Detail

getConnectTimeout

long getConnectTimeout()
How long we will wait for the ACK from a SYN, in milliseconds.

Returns:
milliseconds to wait, or -1 if we will wait indefinitely

setConnectTimeout

void setConnectTimeout(long ms)
Define how long we will wait for the ACK from a SYN, in milliseconds.


getReadTimeout

long getReadTimeout()
What is the longest we'll block on the input stream while waiting for more data. If this value is exceeded, the read() throws InterruptedIOException


setReadTimeout

void setReadTimeout(long ms)
What is the longest we'll block on the input stream while waiting for more data. If this value is exceeded, the read() throws InterruptedIOException


getMaxBufferSize

int getMaxBufferSize()
How much data will we accept that hasn't been written out yet. After this amount has been exceeded, subsequent .write calls will block until either some data is removed or the connection is closed. If this is less than or equal to zero, there is no limit (warning: can eat ram)

Returns:
buffer size limit, in bytes

setMaxBufferSize

void setMaxBufferSize(int numBytes)
How much data will we accept that hasn't been written out yet. After this amount has been exceeded, subsequent .write calls will block until either some data is removed or the connection is closed. If this is less than or equal to zero, there is no limit (warning: can eat ram)


getWriteTimeout

long getWriteTimeout()
What is the longest we'll block on the output stream while waiting for the data to flush. If this value is exceeded, the write() throws InterruptedIOException. If this is less than or equal to zero, there is no timeout.


setWriteTimeout

void setWriteTimeout(long ms)
What is the longest we'll block on the output stream while waiting for the data to flush. If this value is exceeded, the write() throws InterruptedIOException. If this is less than or equal to zero, there is no timeout.