class SocketWrapper extends Object implements I2PSocket
I2PSocket.SocketErrorListener| Constructor and Description |
|---|
SocketWrapper(Socket sock) |
| Modifier and Type | Method and Description |
|---|---|
void | close() |
InputStream | getInputStream()Gets the input stream from the underlying socket. |
int | getLocalPort()The local port. |
I2PSocketOptions | getOptions()Returns the socket's configuration. |
OutputStream | getOutputStream()Gets the output stream from the underlying socket. |
Destination | getPeerDestination()Returns the destination of the peer. |
int | getPort()The remote port. |
long | getReadTimeout()How long we will wait blocked on a read() operation. |
Destination | getThisDestination()Returns the Destination of this side of the socket. |
boolean | isClosed()Returns whether this socket has been closed. |
void | reset()Just calls close() |
void | setOptions(I2PSocketOptions options)Does nothing |
void | setReadTimeout(long ms)setReadTimeout. |
void | setSocketErrorListener(I2PSocket.SocketErrorListener lsnr)Deprecated, unimplemented, does nothing |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLifetimeBytesReceived, getLifetimeBytesSentpublic SocketWrapper(Socket sock)
public void close()
throws IOExceptionclose in interface Closeableclose in interface AutoCloseableIOExceptionpublic InputStream getInputStream() throws IOException
getInputStream in interface I2PSocketIOException - if the socket is closedpublic int getLocalPort()
getLocalPort in interface I2PSocketpublic I2PSocketOptions getOptions()
I2PSocketgetOptions in interface I2PSocketpublic OutputStream getOutputStream() throws IOException
getOutputStream in interface I2PSocketIOException - if the socket is closedpublic Destination getPeerDestination()
I2PSocketgetPeerDestination in interface I2PSocketpublic int getPort()
public long getReadTimeout()
I2PSocketgetReadTimeout in interface I2PSocketpublic Destination getThisDestination()
I2PSocketgetThisDestination in interface I2PSocketpublic boolean isClosed()
I2PSocketpublic void reset()
throws IOExceptionreset in interface I2PSocketIOException - on reset failurepublic void setOptions(I2PSocketOptions options)
setOptions in interface I2PSocketoptions - I2PSocketOptions to setpublic void setReadTimeout(long ms)
setReadTimeout in interface I2PSocketms - timeout in mspublic void setSocketErrorListener(I2PSocket.SocketErrorListener lsnr)
setSocketErrorListener in interface I2PSocketlsnr - the listener (ignored)