class SocketWrapper extends Object implements I2PSocket
I2PSocket.SocketErrorListener| Constructor and Description |
|---|
SocketWrapper(Socket sock) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
SelectableChannel |
getChannel()
Deprecated.
|
InputStream |
getInputStream()
Gets the input stream from the underlying socket.
|
int |
getLocalPort()
The local port.
|
I2PSocketOptions |
getOptions() |
OutputStream |
getOutputStream()
Gets the output stream from the underlying socket.
|
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()
Just calls close()
|
void |
setOptions(I2PSocketOptions options)
Does nothing
|
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
|
public SocketWrapper(Socket sock)
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException@Deprecated public SelectableChannel getChannel()
I2PSocketgetChannel in interface I2PSocketpublic InputStream getInputStream() throws IOException
getInputStream in interface I2PSocketIOException - if the socket is closedpublic int getLocalPort()
getLocalPort in interface I2PSocketpublic I2PSocketOptions getOptions()
getOptions in interface I2PSocketpublic OutputStream getOutputStream() throws IOException
getOutputStream in interface I2PSocketIOException - if the socket is closedpublic Destination getPeerDestination()
getPeerDestination in interface I2PSocketpublic int getPort()
public long getReadTimeout()
I2PSocketgetReadTimeout in interface I2PSocketpublic Destination getThisDestination()
getThisDestination in interface I2PSocketpublic void reset()
throws IOException
reset in interface I2PSocketIOExceptionpublic void setOptions(I2PSocketOptions options)
setOptions 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 I2PSocket