public class Socks5BytestreamRequest extends Object implements BytestreamRequest
Modifier | Constructor and Description |
---|---|
protected |
Socks5BytestreamRequest(Socks5BytestreamManager manager,
Bytestream bytestreamRequest)
Creates a new Socks5BytestreamRequest.
|
Modifier and Type | Method and Description |
---|---|
Socks5BytestreamSession |
accept()
Accepts the SOCKS5 Bytestream initialization request and returns the socket to send/receive
data.
|
static int |
getConnectFailureThreshold()
Returns the number of connection failures it takes for a particular SOCKS5 proxy to be
blacklisted.
|
String |
getFrom()
Returns the sender of the SOCKS5 Bytestream initialization request.
|
int |
getMinimumConnectTimeout()
Returns the timeout to connect to one SOCKS5 proxy while accepting the SOCKS5 Bytestream
request.
|
String |
getSessionID()
Returns the session ID of the SOCKS5 Bytestream initialization request.
|
int |
getTotalConnectTimeout()
Returns the maximum timeout to connect to SOCKS5 proxies.
|
void |
reject()
Rejects the SOCKS5 Bytestream request by sending a reject error to the initiator.
|
static void |
setConnectFailureThreshold(int connectFailureThreshold)
Sets the number of connection failures it takes for a particular SOCKS5 proxy to be
blacklisted.
|
void |
setMinimumConnectTimeout(int minimumConnectTimeout)
Sets the timeout to connect to one SOCKS5 proxy while accepting the SOCKS5 Bytestream
request.
|
void |
setTotalConnectTimeout(int totalConnectTimeout)
Sets the maximum timeout to connect to SOCKS5 proxies.
|
protected Socks5BytestreamRequest(Socks5BytestreamManager manager, Bytestream bytestreamRequest)
manager
- the SOCKS5 Bytestream managerbytestreamRequest
- the SOCKS5 Bytestream initialization packetpublic static int getConnectFailureThreshold()
public static void setConnectFailureThreshold(int connectFailureThreshold)
Setting the connection failure threshold to zero disables the blacklisting.
connectFailureThreshold
- the number of connection failures it takes for a particular
SOCKS5 proxy to be blacklistedpublic int getTotalConnectTimeout()
When accepting a SOCKS5 Bytestream request Smack tries to connect to all SOCKS5 proxies given by the initiator until a connection is established. This timeout divided by the number of SOCKS5 proxies determines the timeout for every connection attempt.
You can set the minimum timeout for establishing a connection to one SOCKS5 proxy by invoking
setMinimumConnectTimeout(int)
.
public void setTotalConnectTimeout(int totalConnectTimeout)
When accepting a SOCKS5 Bytestream request Smack tries to connect to all SOCKS5 proxies given by the initiator until a connection is established. This timeout divided by the number of SOCKS5 proxies determines the timeout for every connection attempt.
You can set the minimum timeout for establishing a connection to one SOCKS5 proxy by invoking
setMinimumConnectTimeout(int)
.
totalConnectTimeout
- the maximum timeout to connect to SOCKS5 proxiespublic int getMinimumConnectTimeout()
public void setMinimumConnectTimeout(int minimumConnectTimeout)
minimumConnectTimeout
- the timeout to connect to one SOCKS5 proxypublic String getFrom()
getFrom
in interface BytestreamRequest
public String getSessionID()
getSessionID
in interface BytestreamRequest
public Socks5BytestreamSession accept() throws InterruptedException, XMPPException.XMPPErrorException, SmackException
Before accepting the SOCKS5 Bytestream request you can set timeouts by invoking
setTotalConnectTimeout(int)
and setMinimumConnectTimeout(int)
.
accept
in interface BytestreamRequest
InterruptedException
- if the current thread was interrupted while waitingXMPPException.XMPPErrorException
SmackException
SmackException.NoResponseException
public void reject() throws SmackException.NotConnectedException
reject
in interface BytestreamRequest
SmackException.NotConnectedException