class I2PSocketFull extends Object implements I2PSocket
I2PSocket.SocketErrorListener| Constructor and Description |
|---|
I2PSocketFull(Connection con,
I2PAppContext context) |
| Modifier and Type | Method and Description |
|---|---|
void | close()Closes this socket. |
(package private) void | destroy()Destroy |
(package private) void | destroy2()Call from Connection.disconnectComplete() |
(package private) Connection | getConnection() |
InputStream | getInputStream()As of 0.9.9 will throw an IOE if socket is closed. |
long | getLifetimeBytesReceived()How many bytes have been received over the lifetime of this socket. |
long | getLifetimeBytesSent()How many bytes have been sent over the lifetime of this socket. |
int | getLocalPort()The local port. |
I2PSocketOptions | getOptions()Returns the socket's configuration. |
OutputStream | getOutputStream()As of 0.9.9 will throw an IOE if socket is closed. |
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()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()toString. |
public I2PSocketFull(Connection con, I2PAppContext context)
con - the underlying connection, may be nullcontext - the I2P application contextpublic void close()
throws IOExceptionclose in interface Closeableclose in interface AutoCloseableIOException - if an I/O error occursvoid destroy()
void destroy2()
Connection getConnection()
public InputStream getInputStream() throws IOException
getInputStream in interface I2PSocketIOException - if the socket is closedpublic long getLifetimeBytesReceived()
I2PSocketgetLifetimeBytesReceived in interface I2PSocketpublic long getLifetimeBytesSent()
I2PSocketgetLifetimeBytesSent in interface I2PSocketpublic 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 - if an I/O error occurspublic void setOptions(I2PSocketOptions options)
I2PSocketsetOptions in interface I2PSocketoptions - the new socket optionspublic void setReadTimeout(long ms)
I2PSocketsetReadTimeout in interface I2PSocketms - the read timeout in millisecondspublic void setSocketErrorListener(I2PSocket.SocketErrorListener lsnr)
setSocketErrorListener in interface I2PSocketlsnr - ignored