|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jivesoftware.smackx.bytestreams.socks5.Socks5BytestreamRequest
public class Socks5BytestreamRequest
Socks5BytestreamRequest class handles incoming SOCKS5 Bytestream requests.
Constructor Summary | |
---|---|
protected |
Socks5BytestreamRequest(Socks5BytestreamManager manager,
Bytestream bytestreamRequest)
Creates a new Socks5BytestreamRequest. |
Method Summary | |
---|---|
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. |
java.lang.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. |
java.lang.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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Socks5BytestreamRequest(Socks5BytestreamManager manager, Bytestream bytestreamRequest)
manager
- the SOCKS5 Bytestream managerbytestreamRequest
- the SOCKS5 Bytestream initialization packetMethod Detail |
---|
public 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 java.lang.String getFrom()
getFrom
in interface BytestreamRequest
public java.lang.String getSessionID()
getSessionID
in interface BytestreamRequest
public Socks5BytestreamSession accept() throws XMPPException, java.lang.InterruptedException
Before accepting the SOCKS5 Bytestream request you can set timeouts by invoking
setTotalConnectTimeout(int)
and setMinimumConnectTimeout(int)
.
accept
in interface BytestreamRequest
XMPPException
- if connection to all SOCKS5 proxies failed or if stream is invalid.
java.lang.InterruptedException
- if the current thread was interrupted while waitingpublic void reject()
reject
in interface BytestreamRequest
|
Smack | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |