class I2PSocketFull extends Object implements I2PSocket
I2PSocket.SocketErrorListener| Constructor and Description |
|---|
I2PSocketFull(Connection con,
I2PAppContext context)Bridge between a connection and the I2PSocket API. |
| Modifier and Type | Method and Description |
|---|---|
void | close()Closes this socket. |
(package private) void | destroy()Release the connection reference. |
(package private) void | destroy2()Call from Connection.disconnectComplete() |
(package private) Connection | getConnection()Underlying connection. |
InputStream | getInputStream()As of 0.9.9 will throw an IOE if socket is closed. |
long | getLifetimeBytesReceived()Total bytes received over the socket's lifetime. |
long | getLifetimeBytesSent()Total bytes sent over the socket's lifetime. |
int | getLocalPort()The local port. |
I2PSocketOptions | getOptions()Socket options for this socket. |
OutputStream | getOutputStream()As of 0.9.9 will throw an IOE if socket is closed. |
Destination | getPeerDestination()Remote peer destination. |
int | getPort()The remote port. |
long | getReadTimeout()Read timeout for this socket. |
Destination | getThisDestination()Local peer destination. |
boolean | isClosed()Whether the socket is closed or not connected. |
void | reset()Resets and closes this socket. |
void | setOptions(I2PSocketOptions options)New socket options. |
void | setReadTimeout(long ms)Read timeout in milliseconds. |
void | setSocketErrorListener(I2PSocket.SocketErrorListener lsnr)Deprecated, unimplemented, does nothing. |
String | toString()Description of this socket. |
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()
getLifetimeBytesReceived in interface I2PSocketpublic long getLifetimeBytesSent()
getLifetimeBytesSent in interface I2PSocketpublic 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()
getReadTimeout in interface I2PSocketpublic Destination getThisDestination()
getThisDestination in interface I2PSocketpublic boolean isClosed()
public void reset()
throws IOExceptionreset in interface I2PSocketIOException - if an I/O error occurspublic void setOptions(I2PSocketOptions options)
setOptions in interface I2PSocketoptions - the new socket optionspublic void setReadTimeout(long ms)
setReadTimeout in interface I2PSocketms - the read timeout in millisecondspublic void setSocketErrorListener(I2PSocket.SocketErrorListener lsnr)
setSocketErrorListener in interface I2PSocketlsnr - ignored