Java Code Examples for cn.jiguang.common.ClientConfig#getConnectionTimeout()

The following examples show how to use cn.jiguang.common.ClientConfig#getConnectionTimeout() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Http2Client.java    From jiguang-java-client-common with MIT License 6 votes vote down vote up
public Http2Client(String authCode, HttpProxy proxy, ClientConfig config) {
    _maxRetryTimes = config.getMaxRetryTimes();
    _connectionTimeout = config.getConnectionTimeout();
    _readTimeout = config.getReadTimeout();
    _sslVer = config.getSSLVersion();

    _authCode = authCode;
    _proxy = proxy;
    _encryptType = config.getEncryptType();
    String message = MessageFormat.format("Created instance with "
                    + "connectionTimeout {0}, readTimeout {1}, maxRetryTimes {2}, SSL Version {3}",
            _connectionTimeout, _readTimeout, _maxRetryTimes, _sslVer);
    LOG.info(message);

    if (null != _proxy && _proxy.isAuthenticationNeeded()) {
        Authenticator.setDefault(new NativeHttpClient.SimpleProxyAuthenticator(
                _proxy.getUsername(), _proxy.getPassword()));
    }
}
 
Example 2
Source File: NativeHttpClient.java    From jiguang-java-client-common with MIT License 6 votes vote down vote up
public NativeHttpClient(String authCode, HttpProxy proxy, ClientConfig config ) {
      _maxRetryTimes = config.getMaxRetryTimes();
_connectionTimeout = config.getConnectionTimeout();
_readTimeout = config.getReadTimeout();
_sslVer = config.getSSLVersion();
      _encryptType = config.getEncryptType();
_authCode = authCode;
_proxy = proxy;

String message = MessageFormat.format("Created instance with "
				+ "connectionTimeout {0}, readTimeout {1}, maxRetryTimes {2}, SSL Version {3}",
		_connectionTimeout, _readTimeout, _maxRetryTimes, _sslVer);
      LOG.debug(message);

      if ( null != _proxy && _proxy.isAuthenticationNeeded()) {
      	Authenticator.setDefault(new SimpleProxyAuthenticator(
              _proxy.getUsername(), _proxy.getPassword()));
      }
      initSSL(_sslVer);
  }
 
Example 3
Source File: ApacheHttpClient.java    From jiguang-java-client-common with MIT License 5 votes vote down vote up
public ApacheHttpClient(String authCode, HttpProxy proxy, ClientConfig config) {
    _maxRetryTimes = config.getMaxRetryTimes();
    _connectionTimeout = config.getConnectionTimeout();
    _connectionRequestTimeout = config.getConnectionRequestTimeout();
    _socketTimeout = config.getSocketTimeout();
    _authCode = authCode;
    _encryptType = config.getEncryptType();
    if (proxy != null) {
        _proxy = new HttpHost(proxy.getHost(), proxy.getPort());
    }
}