java.lang.AutoCloseable
, java.io.Closeable
I2PSocketFull
, SocketWrapper
public interface I2PSocket
extends java.io.Closeable
I2PSocketManager.connect(Destination)
.
Note that this is not a standard Java Socket
,
if you need one of those, use I2PSocketManager.connectToSocket(Destination)
instead.
修飾子とタイプ | インタフェース | 説明 |
---|---|---|
static interface |
I2PSocket.SocketErrorListener |
Deprecated, unimplemented, does nothing.
|
修飾子とタイプ | メソッド | 説明 |
---|---|---|
java.nio.channels.SelectableChannel |
getChannel() |
推奨されていません。
|
java.io.InputStream |
getInputStream() |
As of 0.9.9 will throw an IOE if socket is closed.
|
int |
getLocalPort() |
The local port.
|
I2PSocketOptions |
getOptions() |
|
java.io.OutputStream |
getOutputStream() |
As of 0.9.9 will throw an IOE if socket is closed.
|
Destination |
getPeerDestination() |
|
int |
getPort() |
The remote port.
|
long |
getReadTimeout() |
How long we will wait blocked on a read() operation.
|
Destination |
getThisDestination() |
|
boolean |
isClosed() |
|
void |
reset() |
Resets and closes this socket.
|
void |
setOptions(I2PSocketOptions options) |
Configure the socket
|
void |
setReadTimeout(long ms) |
Define how long we will wait blocked on a read() operation (-1 will make
the socket wait forever).
|
void |
setSocketErrorListener(I2PSocket.SocketErrorListener lsnr) |
Deprecated, unimplemented, does nothing
|
Destination getThisDestination()
Destination getPeerDestination()
java.io.InputStream getInputStream() throws java.io.IOException
Note that operations on the returned stream may return an
IOException
whose cause as returned by
Throwable.getCause()
is an I2PSocketException
.
If so, the client may retrieve a status code via
I2PSocketException.getStatus()
to provide specific feedback to the user.
java.io.IOException
- on failurejava.io.OutputStream getOutputStream() throws java.io.IOException
Note that operations on the returned stream may return an
IOException
whose cause as returned by
Throwable.getCause()
is an I2PSocketException
.
If so, the client may retrieve a status code via
I2PSocketException.getStatus()
to provide specific feedback to the user.
java.io.IOException
- on failure@Deprecated java.nio.channels.SelectableChannel getChannel() throws java.io.IOException
java.io.IOException
I2PSocketOptions getOptions()
void setOptions(I2PSocketOptions options)
options
- I2PSocketOptions to setlong getReadTimeout()
void setReadTimeout(long ms)
ms
- timeout in msboolean isClosed()
void setSocketErrorListener(I2PSocket.SocketErrorListener lsnr)
int getPort()
int getLocalPort()
void reset() throws java.io.IOException
java.io.IOException