public class Socks5BytestreamSession extends Object implements BytestreamSession
Modifier | Constructor and Description |
---|---|
protected |
Socks5BytestreamSession(Socket socket,
boolean isDirect) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the bytestream session.
|
InputStream |
getInputStream()
Returns the InputStream associated with this session to send data.
|
OutputStream |
getOutputStream()
Returns the OutputStream associated with this session to receive data.
|
int |
getReadTimeout()
Returns the timeout for read operations of the input stream associated with this session.
|
boolean |
isDirect()
Returns
true if the session is established through a direct connection between
the initiator and target, false if the session is mediated over a SOCKS proxy. |
boolean |
isMediated()
Returns
true if the session is mediated over a SOCKS proxy, false
if this session is established through a direct connection between the initiator and target. |
void |
setReadTimeout(int timeout)
Sets the specified timeout, in milliseconds.
|
protected Socks5BytestreamSession(Socket socket, boolean isDirect)
public boolean isDirect()
true
if the session is established through a direct connection between
the initiator and target, false
if the session is mediated over a SOCKS proxy.true
if session is a direct connection, false
if session is
mediated over a SOCKS5 proxypublic boolean isMediated()
true
if the session is mediated over a SOCKS proxy, false
if this session is established through a direct connection between the initiator and target.true
if session is mediated over a SOCKS5 proxy, false
if
session is a direct connectionpublic InputStream getInputStream() throws IOException
BytestreamSession
getInputStream
in interface BytestreamSession
IOException
- if an error occurs while retrieving the input streampublic OutputStream getOutputStream() throws IOException
BytestreamSession
getOutputStream
in interface BytestreamSession
IOException
- if an error occurs while retrieving the output streampublic int getReadTimeout() throws IOException
BytestreamSession
getReadTimeout
in interface BytestreamSession
IOException
- if there is an error in the underlying protocolpublic void setReadTimeout(int timeout) throws IOException
BytestreamSession
setReadTimeout
in interface BytestreamSession
timeout
- the specified timeout, in millisecondsIOException
- if there is an error in the underlying protocolpublic void close() throws IOException
BytestreamSession
Closing the session will also close the input stream and the output stream associated to this session.
close
in interface BytestreamSession
IOException
- if an error occurs while closing the session