Initial implementation of read() timeout on I2PSocket. Let's see whether it

could solve duck's problems with dangling threads...
(human)
This commit is contained in:
human
2004-04-21 17:56:16 +00:00
committed by zzz
parent 58e7574a6a
commit d7c3a53f2d
3 changed files with 56 additions and 6 deletions

View File

@@ -32,8 +32,22 @@ public interface I2PSocket {
*/
public OutputStream getOutputStream() throws IOException;
/**
* How long we will wait blocked on a read() operation.
*
* @return milliseconds to wait, or -1 if we will wait indefinitely
*/
public long getReadTimeout();
/**
* Define how long we will wait blocked on a read() operation (-1 will make
* the socket wait forever).
*
*/
public void setReadTimeout(long ms);
/**
* Closes the socket if not closed yet
*/
public void close() throws IOException;
}
}