Closeable, AutoCloseable, I2PSocketclass I2PSocketFull extends Object implements I2PSocket
I2PSocket.SocketErrorListener| Constructor | Description |
|---|---|
I2PSocketFull(Connection con,
I2PAppContext context) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes this socket.
|
(package private) void |
destroy() |
|
(package private) void |
destroy2() |
Call from Connection.disconnectComplete()
instead of destroy() so we don't loop
|
SelectableChannel |
getChannel() |
Deprecated.
|
(package private) Connection |
getConnection() |
|
InputStream |
getInputStream() |
As of 0.9.9 will throw an IOE if socket is closed.
|
int |
getLocalPort() |
The local port.
|
I2PSocketOptions |
getOptions() |
|
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
|
String |
toString() |
public I2PSocketFull(Connection con, I2PAppContext context)
public void close()
throws IOException
close in interface AutoCloseableclose in interface CloseableIOExceptionpublic void reset()
throws IOException
reset in interface I2PSocketIOExceptionConnection getConnection()
public InputStream getInputStream() throws IOException
getInputStream in interface I2PSocketIOException - on failurepublic I2PSocketOptions getOptions()
getOptions in interface I2PSocket@Deprecated public SelectableChannel getChannel()
getChannel in interface I2PSocketpublic OutputStream getOutputStream() throws IOException
getOutputStream in interface I2PSocketIOException - on failurepublic Destination getPeerDestination()
getPeerDestination in interface I2PSocketpublic long getReadTimeout()
I2PSocketgetReadTimeout in interface I2PSocketpublic Destination getThisDestination()
getThisDestination in interface I2PSocketpublic void setOptions(I2PSocketOptions options)
I2PSocketsetOptions in interface I2PSocketoptions - I2PSocketOptions to setpublic void setReadTimeout(long ms)
I2PSocketsetReadTimeout in interface I2PSocketms - timeout in mspublic void setSocketErrorListener(I2PSocket.SocketErrorListener lsnr)
setSocketErrorListener in interface I2PSocketvoid destroy()
void destroy2()
public int getPort()
public int getLocalPort()
getLocalPort in interface I2PSocket