Class Socks5BytestreamRequest

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Socks5BytestreamSession accept()
      Accepts the SOCKS5 Bytestream initialization request and returns the socket to send/receive data.
      int getConnectFailureThreshold()
      Returns the number of connection failures it takes for a particular SOCKS5 proxy to be blacklisted.
      static int getDefaultConnectFailureThreshold()
      Returns the default connection failure threshold.
      Jid 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.
      void setConnectFailureThreshold​(int connectFailureThreshold)
      Sets the number of connection failures it takes for a particular SOCKS5 proxy to be blacklisted.
      static void setDefaultConnectFailureThreshold​(int defaultConnectFailureThreshold)
      Sets the default connection failure threshold.
      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

      • Socks5BytestreamRequest

        protected Socks5BytestreamRequest​(Socks5BytestreamManager manager,
                                          Bytestream bytestreamRequest)
        Creates a new Socks5BytestreamRequest.
        Parameters:
        manager - the SOCKS5 Bytestream manager
        bytestreamRequest - the SOCKS5 Bytestream initialization packet
    • Method Detail

      • getConnectFailureThreshold

        public int getConnectFailureThreshold()
        Returns the number of connection failures it takes for a particular SOCKS5 proxy to be blacklisted. When a proxy is blacklisted no more connection attempts will be made to it for a period of 2 hours. Default is 2.
        Returns:
        the number of connection failures it takes for a particular SOCKS5 proxy to be blacklisted
      • setConnectFailureThreshold

        public void setConnectFailureThreshold​(int connectFailureThreshold)
        Sets the number of connection failures it takes for a particular SOCKS5 proxy to be blacklisted. When a proxy is blacklisted no more connection attempts will be made to it for a period of 2 hours. Default is 2.

        Setting the connection failure threshold to zero disables the blacklisting.

        Parameters:
        connectFailureThreshold - the number of connection failures it takes for a particular SOCKS5 proxy to be blacklisted
      • getTotalConnectTimeout

        public int getTotalConnectTimeout()
        Returns the maximum timeout to connect to SOCKS5 proxies. Default is 10000ms.

        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).

        Returns:
        the maximum timeout to connect to SOCKS5 proxies
      • setTotalConnectTimeout

        public void setTotalConnectTimeout​(int totalConnectTimeout)
        Sets the maximum timeout to connect to SOCKS5 proxies. Default is 10000ms.

        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).

        Parameters:
        totalConnectTimeout - the maximum timeout to connect to SOCKS5 proxies
      • getMinimumConnectTimeout

        public int getMinimumConnectTimeout()
        Returns the timeout to connect to one SOCKS5 proxy while accepting the SOCKS5 Bytestream request. Default is 2000ms.
        Returns:
        the timeout to connect to one SOCKS5 proxy
      • setMinimumConnectTimeout

        public void setMinimumConnectTimeout​(int minimumConnectTimeout)
        Sets the timeout to connect to one SOCKS5 proxy while accepting the SOCKS5 Bytestream request. Default is 2000ms.
        Parameters:
        minimumConnectTimeout - the timeout to connect to one SOCKS5 proxy
      • getFrom

        public Jid getFrom()
        Returns the sender of the SOCKS5 Bytestream initialization request.
        Specified by:
        getFrom in interface BytestreamRequest
        Returns:
        the sender of the SOCKS5 Bytestream initialization request.
      • getSessionID

        public java.lang.String getSessionID()
        Returns the session ID of the SOCKS5 Bytestream initialization request.
        Specified by:
        getSessionID in interface BytestreamRequest
        Returns:
        the session ID of the SOCKS5 Bytestream initialization request.